tiny-tokio-actor icon indicating copy to clipboard operation
tiny-tokio-actor copied to clipboard

Some missing parts

Open oblique opened this issue 3 years ago • 2 comments

I really liked your crate and wanted to test it and even migrate to it from Actix.

I tried to migrate a small part but I found two missing parts:

  1. I couldn't find a way to get ActorRef of Actor itself or from its ActorContext.
  2. I couldn't find an equivalent to actix::Recipient.

Are they indeed missing?

oblique avatar Feb 17 '22 09:02 oblique

The actor Context does have the system, and from there you can use get_actor or get_or_create_actor.

There is no equivalent yet for actix::Recipient. I will see if I can add something similar. Pull requests are also welcome :)

fdeantoni avatar May 21 '22 16:05 fdeantoni

came here to ask about this. I did discover the author's suggestion but a cleaner method would be cool.

let self_ref = _ctx.system.get_actor::<FooActor>(&_ctx.path).await.unwrap()

my use case is spawning a task in a call to handle which at some point in the future needs to ask/tell itself something.

dougcooper avatar Jan 19 '23 11:01 dougcooper