randomPoison / thespian

An experiment in designing an ergonomic actor framework for Rust
1 stars 0 forks source link

Make message queue size configurable #14

Open randomPoison opened 4 years ago

randomPoison commented 4 years ago

Right now actors have fixed message queue size of 16. We should expose this as a configuration options as part of the stage construction process. Once #13 is done, we should also provide an option for setting up an actor with an unbounded message queue (though we should push them towards using a bounded queue by default because back pressure).

The only concern here is how we provide this configuration to the stage builder. Currently we need to create the channel when we create the stage builder, so we ironically can't use the stage builder for a builder pattern in this case. Instead, we probably want to define a simple configuration struct that can be passed into Stage::new() or Actor::spawn() to configure the stage's internals.