protected virtual IHazelcastInstance CreateClient()
 {
     var clientFactory = new HazelcastClientFactory();
     var resetEvent = new ManualResetEventSlim();
     var listener = new ListenerConfig(new LifecycleListener(l =>
     {
         if (l.GetState() == LifecycleEvent.LifecycleState.ClientConnected)
         {
             resetEvent.Set();
         }
     }));
     var client = clientFactory.CreateClient(c =>
     {
         ConfigureClient(c);
         c.AddListenerConfig(listener);
     });
     Assert.IsTrue(resetEvent.Wait(30*1000), "Client did not start after 30 seconds");
     return client;
 }
예제 #2
0
 public virtual ClientConfig AddListenerConfig(ListenerConfig listenerConfig)
 {
     GetListenerConfigs().Add(listenerConfig);
     return(this);
 }