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

Store global logger guard for the lifetime of the actor system #95

Closed mrjoe7 closed 4 years ago

mrjoe7 commented 4 years ago

This is addressing issue found in #78

mkj commented 4 years ago

Hah, beat me by minutes. Yours looks good, there's a test you could add https://github.com/mkj/riker/commit/084118ffff53ac951b03735f3b98ee557b4bc78d

leenozara commented 4 years ago

I’m just wondering if System S should require both the logger and the log guard as separate parameters. I can imagine if System evolves then using the same approach with other parts will make the number of parameters pretty long. Is a single struct that contains both the logger and guard cleaner? Or is this clunky? Appreciate some thoughts on this before merging.

Thanks

mrjoe7 commented 4 years ago

I do not expect any additional fields to emerge, but single struct to hold both fields will be nicer.

leenozara commented 4 years ago

I think this sets a good precedent re consolidating into a common type.

Thanks @mrjoe7 and @mkj !