void OnDestroy()
 {
     if (this.scheduled != null)
     {
         this.scheduled.Stop();
         this.scheduled = null;
     }
 }
Exemple #2
0
 /// <summary>
 /// Creates a heartbeat manager which actively sends heartbeats to monitoring targets.
 /// </summary>
 /// <typeparam name="TInput">Type of the incoming payload</typeparam>
 /// <typeparam name="TOutput">Type of the outgoing payload</typeparam>
 /// <param name="resourceId">Resource Id which identifies the owner of the heartbeat manager</param>
 /// <param name="heartbeatListener">Listener which will be notified upon heartbeat timeouts for registered targets</param>
 /// <param name="mainThreadExecutor">Scheduled executor to be used for scheduling heartbeat timeouts and periodically send heartbeat requests</param>
 /// <param name="log">Logger to be used for the logging</param>
 /// <returns>A new HeartbeatManager instance which actively sends heartbeats</returns>
 public IHeartbeatManager <TInput, TOutput> CreateHeartbeatManagerSender <TInput, TOutput>(
     ResourceId resourceId,
     IHeartbeatListener <TInput, TOutput> heartbeatListener,
     IScheduledExecutor mainThreadExecutor,
     ILogger log)
 {
     return(null);
 }
        void Start()
        {
//		this.scheduled = new CoroutineScheduledExecutor (); /* run on the main thread. */
            this.scheduled = new ThreadScheduledExecutor();              /* run on the background thread. */
            this.scheduled.Start();

            IAsyncResult result = this.scheduled.ScheduleAtFixedRate(() => {
                Debug.Log("This is a test.");
            }, 1000, 2000);
        }
Exemple #4
0
 public TaskContext()
 {
     scheduled = new CoroutineScheduledExecutor();
     scheduled.Start();
 }
 public SchedulersHostedService(IScheduledExecutor scheduledExecutor)
 {
     this.scheduledExecutor = scheduledExecutor;
 }