Exemplo n.º 1
0
        private void Ready()
        {
            Receive <IStartJobV1>(start =>
            {
                JobToStart = start;

                // contact all of our peers and see if this job is already running
                ApiBroadcaster.Tell(new FindRunningJob(start.Job));

                // and see if we've done this job before
                Context.ActorSelection("/user/downloads").Tell(new DownloadsMaster.RequestDownloadTrackerFor(start.Job, Self));

                Become(SearchingForJob);
                var members = ApiBroadcaster.Ask <Routees>(new GetRoutees()).Result.Members.ToList();
                OutstandingAcknowledgements = members.Count();
                Context.SetReceiveTimeout(TimeSpan.FromSeconds(3.0));
            });

            Receive <FindRunningJob>(job => HandleFindRunningJob(job));
        }
        private void Ready()
        {
            Receive<IStartJobV1>(start =>
            {
                JobToStart = start;

                // contact all of our peers and see if this job is already running
                ApiBroadcaster.Tell(new FindRunningJob(start.Job));

                // and see if we've done this job before
                Context.ActorSelection("/user/downloads").Tell(new DownloadsMaster.RequestDownloadTrackerFor(start.Job, Self));

                Become(SearchingForJob);
                var members = ApiBroadcaster.Ask<Routees>(new GetRoutees()).Result.Members.ToList();
                OutstandingAcknowledgements = members.Count();
                Context.SetReceiveTimeout(TimeSpan.FromSeconds(3.0));
            });

            Receive<FindRunningJob>(job => HandleFindRunningJob(job));
        }
 public AttemptToStartJob(IStartJobV1 job)
 {
     Job = job;
 }
 public CrawlCanStart(IStartJobV1 job, int nodeCount)
 {
     Job       = job;
     NodeCount = nodeCount;
 }
 public AttemptToStartJob(IStartJobV1 job)
 {
     Job = job;
 }
 public CrawlCanStart(IStartJobV1 job, int nodeCount)
 {
     Job = job;
     NodeCount = nodeCount;
 }