Skip to content

Instantly share code, notes, and snippets.

@Blind-Striker
Last active September 5, 2017 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Blind-Striker/b9f8b5d4dd6a1dfec8b59c0f32623430 to your computer and use it in GitHub Desktop.
Save Blind-Striker/b9f8b5d4dd6a1dfec8b59c0f32623430 to your computer and use it in GitHub Desktop.
Sample code for Akka.Net Medium Article
public class ApiActor : ReceiveActor
{
private readonly IActorRef _watchedVideoActor;
private readonly IActorRef _videoActor;
private readonly IActorRef _recommandationActor;
public ApiActor(IActorRef watchedVideoActor)
{
_watchedVideoActor = watchedVideoActor;
_recommandationActor = Context.ActorOf(Props.Create<RecommandationActor>(watchedVideoActor));
Receive<LoginMessage>(message =>
{
// Login işlemleri
_recommandationActor.Tell(new StartRecommendation(message.UserId, Sender));
});
Receive<WatchedVideoEvent>(videos =>
{
_watchedVideoActor.Tell(videos, Sender);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment