riker-rs / riker

Easily build efficient, highly concurrent and resilient applications. An Actor Framework for Rust.
https://riker.rs
MIT License
1.02k stars 69 forks source link

Allow for fully async actors #74

Closed mrjoe7 closed 5 years ago

mrjoe7 commented 5 years ago

This is a proposal of changes needed for use of the futures friendly mutex and mpsc channel mentioned in #73.

Tests will not compile yet, because Actor trait was not updated to have async methods.

To make this work multiple api functions had to be changed to async. Also I have changed few traits to have async methods with the help of async-trait crate.

@leenozara are you ok with the use of the async-trait crate?

leenozara commented 5 years ago

Hi @mrjoe7, thanks, let me dig in and see the overall impact on the API.

mrjoe7 commented 5 years ago

@leenozara I have pushed final proposal how fully async system could look like. Please let me know what do you think.

mrjoe7 commented 5 years ago

I was looking at performance of the proposed async actors and noticed that tell and try_tell are now approximately 2-3x times slower. Not sure if I like that. Also release compilation takes like forever because compiler has to do lots of optimizations.