dice.camp is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon server for RPG folks to hang out and talk. Not owned by a billionaire.

Administered by:

Server stats:

1.7K
active users

#tokio

7 posts3 participants0 posts today

#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?

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.

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

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 #ファッション

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.

developerlife.com/2024/01/13/w

developerlife.com · Write a simple TCP chat server in RustA guide on how to create write a simple TCP chat server in Rust using Tokio