Beispiel #1
0
 public SkynetClient(string clientName, IClient client, T800 runner)
 {
     this.client = client;
     ClientName  = clientName;
     container   = new BasicContainer();
     container.Register(() => this);
     container.Register <T800>(() => new BasicModel(runner));
     timer = new Timer((x) => { if (SkynetConnection != null)
                                {
                                    SkynetConnection.SendMessage(new Heartbeat(Process.GetCurrentProcess().Id));
                                }
                       }, null, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(10));
     subscription = client.Subscribe(this);
 }
Beispiel #2
0
 public void OnNext(IConnection connection)
 {
     SkynetConnection = new SkynetConnection(ClientName, connection, new SkynetPublisher(container.Resolve), new JsonSerializer());
     if (redirectOutput)
     {
         SkynetConnection.SendMessage(new RedirectHostOutput());
     }
     if (@event != null)
     {
         @event.Set();
         ReleaseWait();
     }
 }