tqwewe / kameo

Fault-tolerant Async Actors Built on Tokio
https://docs.page/tqwewe/kameo
Apache License 2.0
633 stars 16 forks source link

fix!: `attach_stream` panicking when actor is stopped #46

Closed tqwewe closed 1 month ago

tqwewe commented 1 month ago

Fixes https://github.com/tqwewe/kameo/issues/45

As described in the issue, there was a panic that occured when using attach_stream on an actor that stops. This PR fixes this by using the SendMessage trait.

Additionally, the spawned tokio task stops when the stream returns None, and returns the stream.