Last active
September 5, 2017 10:06
-
-
Save Blind-Striker/b9f8b5d4dd6a1dfec8b59c0f32623430 to your computer and use it in GitHub Desktop.
Sample code for Akka.Net Medium Article
This file contains 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
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