idanarye / woab

Widgets on Actors Bridge - a GUI microframework for combining GTK with Actix
https://crates.io/crates/woab
MIT License
14 stars 1 forks source link

Extract the Tokio runtime bit #50

Open piegamesde opened 2 years ago

piegamesde commented 2 years ago

So I've switched to vanilla Gtk4 and I'm mostly fine, however in async contexts I'd really like to do Tokio related stuff. If I understand correctly, https://github.com/idanarye/woab/blob/master/src/event_loops_bridge.rs did pretty much that in woab, but through the Actix API (I assume that it is just an abstraction over Tokio here). Would it be possible to extract only that part and make it only depend on Tokio, so that it may be used in Gtk 4 projects?

idanarye commented 2 years ago

I think you can just copy-paste it to your project and adjust it. Most of the Actix things I use there have direct Tokio equivalent - except these two lines in close_actix_runtime():

actix::System::current().stop();
Ok(woab_runtime.actix_system_runner.run())

Both of them are for stopping the Actix actors though (I think - haven't touched this in a loooong time...) so I don't think you'll even need this function.

piegamesde commented 2 years ago

Thanks, I'll try that. (Also, I should have opened a discussion, can you move issues afterwards?)