Пример #1
0
        public void Register(IDataServiceSchedulerClient client)
        {
            lock (this.clientSyncRoot)
            {
                if (!this.clients.Contains(client))
                {
                    this.clients.Add(client);

                    string currentTaskId = null;
                    List<string> toComeTaskIds = null;
                    lock (this.taskSyncRoot)
                    {
                        if (this.currentTask != null)
                        {
                            currentTaskId = this.currentTask.Parameters.Id;
                        }
                        if (this.tasks != null && this.tasks.Count > 0)
                        {
                            toComeTaskIds = this.tasks.Select(x => x.Parameters.Id).ToList();
                        }
                    }
                    client.TaskRunning(currentTaskId, toComeTaskIds);
                }
            }
        }
Пример #2
0
 public void Unregister(IDataServiceSchedulerClient client)
 {
     lock (this.clientSyncRoot)
     {
         if (this.clients.Contains(client))
         {
             this.clients.Remove(client);
         }
     }
 }
 public void Unregister(IDataServiceSchedulerClient client)
 {
     scheduler.Unregister(client);
 }