Skip to content

Add method to ActorContext to invoke a block in the actor context #3

@sdether

Description

@sdether

Since any async invocation that isn't an actor method will continue via a ContinueWith governed by its scheduler, the continuation would be running in the scope of the actor but on its own thread. While this likely cannot be avoided, the actor's Context property should have a method to invoke an action via the actor dispatch loop. The simplest syntax might look something like

someasyncMethod().ContinueInContext(Context, t => {
  ...
});

i.e. an extension method on task that takes the Context and then creates a new Message out of the continuation and stuffs it in the mailbox.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions