Created
December 11, 2019 20:47
-
-
Save arkadiuszwojcik/3c335cccddfcd8fa7beded88c398b72d to your computer and use it in GitHub Desktop.
Test scoped actor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ActorScope(typeof(ActorScopeInstaller))] | |
public class TestActor : IActor | |
{ | |
public Task ReceiveAsync(IContext context) | |
{ | |
switch (context.Message) | |
{ | |
case Started _: | |
var scopeContext = context as ActorScopeContext; | |
var pid = scopeContext.Spawn<SomeActor>(); | |
break; | |
case Stopped _: | |
break; | |
default: | |
break; | |
} | |
return Actor.Done; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment