I've found a workaround :
Now maybe I could find a way to make it work without crossterm, but that's good enough for me right now.
I've found a workaround :
Now maybe I could find a way to make it work without crossterm, but that's good enough for me right now.
#rust #rustlang #tokio #rustyscript
I don't understand why I can't abort a thread in which I construct, setup then use a rustyscript runtime. The runtime stays in this single thread. Yet the program crash because there is a block_on instruction in the load_module function?
I can stop a script by killing the application but I can't abort the thread?
This seems kinda dumb.
#[tokio::main]
async fn main() {
println!("Hello, world!");
let handle = async {
let mut a = 1;
a += 3;
sleep(Duration::from_secs(2)).await;
println!("A is {a}");
};
let kill = || async {
let mut buf = BytesMut::with_capacity(10);
let mut input = io::stdin();
input.read_buf(&mut buf).await.unwrap();
buf
};
select! {
_ = tokio::spawn(handle) => {
println!("thread terminated before end of programme");
}
_ = tokio::spawn(kill()) => {
println!("you decided to kill the program");
}
};
}
shouldn't select drop the thread which doesn't end first?
#rustyscript #iced_rs #tokio #rustlang #rust
(I don't thing switching to future or another lib would change much, but if you think I'm wrong please explain)
So...
You might have read me tell you about how I was... not having a great time trying to make #rustyscript and #iced_rs work well together and failing....
Specifically I couldn't find a way to stop the execution of a script. (I have script with long pauses waiting for stuff to happen IRL, and when the script is wrong, having to either close the application or wait until the end of the script is not great).
Turns out... I can't do that. Either because rustyscript's "load_modules" or "eval" can't be cancelled... Or maybe because a function I declare for the runtime use a blocking operation.
I still have some tests to do, but more to the point I need to really up my #tokio game.
Guten Morgen miteinander!
Heute ist der 8. April und in #Japan feiert man heute das Hana Matsuri, das farbenfrohe #Blumenfest ganz traditionell! Dieses Datum markiert gleichzeitig den buddhistischen Ehrentag der Geburt #Buddhas und fällt häufig mit dem prachtvollen Erscheinen der #Kirschblüten in #Tokio zusammen.
I'm pairing with @meejah on #tokio https://tokio.rs/tokio/tutorial/shared-state#holding-a-mutexguard-across-an-await and we found a bug?
That "this does not work" section works fine on my #rust 1.87-nightly and meejah's 1.84
I checked on MutexGuard, it's explicitly !Send ( https://doc.rust-lang.org/std/sync/struct.MutexGuard.html#impl-Send-for-MutexGuard%3C'_,+T%3E )
So why does this compile when the tutorial says IT DOES NOT? https://github.com/magicinternetproject/echo_server/blob/main/src/main.rs#L63
Anyone working with rdkafka and Tokio on Rust? I took a dive into the deep end without any water wings and need to get a firm grasp of spawn, await, etc.. The problem is limiting the resources my application absorbs so it won’t clobber everything else running when the rate of incoming telemetry suddenly spikes due to a short period of activity on the network.
My current solution is to contain things using systemd, but it is kludge. If you’ve seen a video series, book, or blog where these topics are discussed, I would be grateful if you shared.
#rust #cybersecurity #kafka #tokio #programming
https://www.moezine.com/1774228/ tokio 2025年秋冬コレクション | 東京 | 画像72枚 デザイナーの木村登喜夫による「トキオ(tokio)」が、ブランド初のショーを「Rakuten Fashion Week TOKYO 2025 A/W」で発表した。木村は文化服装学院を卒業後、数々のアパレル製産メーカーやレザークラフトメーカーに加え、アイドルの衣装制作や映画のスタイリングなど多様なジャンルを経験し、2021年に自身の名前を冠した同ブランドを始動。「デザイナーの中のPUNK精神に基づき、自身の手でまだ見たことのないものへ興味を探求し続ける。憧れのclassicを表現するために100%の力注ぐ」をモットーに全て手作りによるアイテムを揃え、クラウドファウンディングなどで資金を集めながらインディペンデントなブランド運営を続け、着実にファンを増やしてきた。2024年9月には、「TOKYO FASHION AWARD」で馬場賢吾の「カネマサフィル(… #2025AW #fashion #TOKIO #ファッション
Unraveling the Mysteries of Linux: How a Simple Flag Revolutionized AI Output Latency
In a captivating journey through the depths of the Linux kernel, a developer at Recall.ai uncovers the hidden intricacies behind process management that led to a staggering 83% reduction in AI output ...
I'm going to bite someone...
how do I clone a Arc into an async_callback ?
Rust’s Tokio library/crate seems pretty powerful. Followed a tutorial to create a basic chat server with it and it was quite easy in the end. Couldn’t have done it without a tutorial, of course, but the amount of code is minimal. Now trying to modify it a bit and introduce a binary packet format instead of a text line based one. Slow work, have to google everything.
http://developerlife.com/2024/01/13/write-simple-chat-server-in-rust/
Das Arbeitsleben in #Japan ist als familienunfreundlich bekannt. Inmitten niedriger Geburtenraten wagt die Metropolregion #Tokio nun einen Vorstoß: die Möglichkeit der Vier-Tage-Woche. https://www.nd-aktuell.de/artikel/1187882.oeffentlicher-dienst-in-tokio-willkommen-vier-tage-woche.html