junkdog / tachyonfx

shader-like effects library for ratatui applications
MIT License
662 stars 8 forks source link

Send for Shaders? #8

Closed grampelberg closed 1 month ago

grampelberg commented 2 months ago

I'm using Tokio for my event/render loop and would love to be able to Send. It looks like there's Rc<RefCell<T>> so that might not be worth the effort, I'm not sure I understand all the implications.

Note: tokio::task::spawn_local gets rid of the Send requirement.

For some added details, I'm working on a custom SSH server that draws a dashboard per-connection, so I do a tokio::spawn for the event/render loop on each connection.

junkdog commented 1 month ago

I think I'll need to experiment a bit with async ratatui. I presume Send is sufficient or is Sync also required?

grampelberg commented 1 month ago

Send is all that is required for my use case, luckily.

junkdog commented 1 month ago

It's WIP, but have a look at the sendable-effects branch and see if looks/works ok.

It all or nothing, feature-gated behind "sendable". I'm not sure it's the best approach, but it was the least invasive option.

junkdog commented 1 month ago

merged to development