public VideoRepoActor() { _movieRepository = new MovieRepository(); Receive <UserUnwatchedVideoRequest>(request => { IActorRef actorRef = Sender; StartRecommendation startRecommendation = request.ResponseStartRecommendation; _movieRepository.GetUnseenVideosAsync(request.Videos).ContinueWith(task => { Video[] taskResult = task.Result; actorRef.Tell(new UserUnwatchedVideoResponse(startRecommendation, taskResult)); }); }); }
public VideoRepoActor() { _movieRepository = new MovieRepository(); Receive <UserUnwatchedVideoRequest>(request => { IActorRef actorRef = Sender; StartRecommendation startRecommendation = request.ResponseStartRecommendation; Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine($"History of videos for {request.ResponseStartRecommendation.UserId} that watched before has come, requesting for recommended videos."); Console.ResetColor(); Thread.Sleep(50); Video[] unseenVideos = _movieRepository.GetUnseenVideos(request.Videos ?? new int[0]); actorRef.Tell(new UserUnwatchedVideoResponse(startRecommendation, unseenVideos)); }); }
public UserWatchHistoryResponse(StartRecommendation startRecommendation, int[] videoIds) { _startRecommendation = startRecommendation; _videoIds = videoIds; }
public JobAttemptMessage(StartRecommendation job, bool canStart) { _job = job; _canStart = canStart; }
public UserUnwatchedVideoRequest(StartRecommendation responseStartRecommendation, int[] watchedVideos) { _responseStartRecommendation = responseStartRecommendation; _watchedVideos = watchedVideos; }
public BeginAttempt(StartRecommendation startRecommendation) { _startRecommendation = startRecommendation; }
public UserWatchHistoryRequest(StartRecommendation recommendation) { _recommendation = recommendation; }
public UserWatchedVideoRequest(StartRecommendation attemptRecommendation) { _attemptRecommendation = attemptRecommendation; }