Skip to content

Instantly share code, notes, and snippets.

@bruinbrown bruinbrown/Endpoint.cs Secret
Created Aug 20, 2015

Embed
What would you like to do?
An example of using Ask in Akka.Net with Web API
public async Task<List<string>> RegisteredUsers(string serviceId)
{
var system = Global.System;
var serviceActorAddress = String.Format("/user/service/{0}", serviceId);
var resp = await system.ActorSelection(serviceActorAddress).Ask(RegisteredUsersRequest.Instance);
return resp;
}
public class ServiceActor : UntypedActor
{
List<string> _registeredUsers = new List<string>();
protected override void OnReceive(object message)
{
if(message is RegisteredUsersRequest)
{
Sender.Tell(_registeredUsers);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.