Exemplo n.º 1
0
 private void Register()
 {
     var registration = new Register { Name = name, UUID = uuid, Configuration = config };
     while (!mediator.Register(registration))
     {
         Console.WriteLine("Registration failed... reattempting in 5 seconds...");
         Thread.Sleep(5000);
     }
 }
Exemplo n.º 2
0
        public void RegisterNew(Register registration)
        {
            var uuid = registration.UUID;
            var name = registration.Name;
            var config = registration.Configuration;
            var newNode = new ComputeConnector(uuid, name, config);

            lock (controllerLock)
            {
                computeNodes.Add(newNode);
            }
        }
Exemplo n.º 3
0
 public void Unregister(Register registration)
 {
     lock (controllerLock)
     {
         var nodeToRemove = computeNodes.Find(cn => cn.UUID == registration.UUID);
         // TODO figure out how to reset calculations in progress
         computeNodes.Remove(nodeToRemove);
     }
 }