Replies: 5 comments
-
In order to determine if an actor panicked, there's essentially two flows. Flow 1: Actor panicked in
|
Beta Was this translation helpful? Give feedback.
-
In a test-case, I'd wait for the actor to exit however if it actually failed, there isn't a clear way to capture the panic without a supervisor (and that's somewhat by design). |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. Yeah, the fact that it's hard to crash the system is very nice to be honest. In testing it's a little inconvenient, but that's a good trade-off I would say. Another question/feature request would be, is there a way to stop the actor but don't stop processing messages already in the queue? The A functionality that signals to the actor to stop receiving new messages, finish processing the ones in the queue and then stop would be great! |
Beta Was this translation helpful? Give feedback.
-
There is, it's called drain or drain_and_wait. You might just need to upgrade your version if you don't have it already |
Beta Was this translation helpful? Give feedback.
-
Ah alright, awesome! I will update and try it out, thank you! |
Beta Was this translation helpful? Give feedback.
-
Hello! First of all, thank you for this great crate, appreciate it a lot.
I have a question regarding testing. As far as I can see, the panics are caught and I don't see a way to figure out that an
Actor
panicked. When using actors in tests, this means that tests pass even though something panicked somewhere. Is there a way to make it so that panic gets propagated and makes the test fail?Beta Was this translation helpful? Give feedback.
All reactions