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

add a public get_tree() method and have print_tree use it #83

Open tupshin opened 4 years ago

tupshin commented 4 years ago

Note that I found this useful when debugging and I didn't have access to a normal stdout.

hardliner66 commented 4 years ago

I don't think exposing a string representation of the internal state is a good idea.

It would be better to just change the println! calls with debug! calls from the log crate. This way you could add a different log targets depending on your needs, without exposing internal state.

olexiyb commented 4 years ago

merged it into actors.rs

leenozara commented 4 years ago

Hi @tupshin thanks for the input. I think you've identified a valid problem, however @hardliner66 has a valid point re not using a string representation. My concern would be larger actor systems that have several thousand or more actors and the allocation to append each actor name. Maybe there is a more effective way to solve the problem that you've identified?