public void Start() { if (!hasStarted.SetTrueIf(false)) { throw new InvalidOperationException("RestBus Subscriber has already started!"); } Restart(); }
/// <summary> /// Starts the host /// </summary> internal void Start() { if (!hasStarted.SetTrueIf(false)) { throw new InvalidOperationException("RestBus host has already started!"); } subscriber.Start(); Task.Factory.StartNew(RunLoop, creationOptions: TaskCreationOptions.LongRunning); }
/// <summary> /// Starts the host /// </summary> internal void Start() { if (!hasStarted.SetTrueIf(false)) { throw new InvalidOperationException("KafkaBus host has already started!"); } this.logger.LogInformation($"{nameof(KafkaBusHost<TContext>)} is starting."); subscriber.Start(); Task.Factory.StartNew(RunLoop, creationOptions: TaskCreationOptions.LongRunning); }
public void Start() { if (!hasStarted.SetTrueIf(false)) { throw new InvalidOperationException("RestBus host has already started!"); } subscriber.Start(); System.Threading.Thread msgLooper = new System.Threading.Thread(RunLoop); msgLooper.Name = "RestBus WebApi Host"; msgLooper.IsBackground = true; msgLooper.Start(); }
/// <summary> /// Sets a flag that indicates that pool should not be used any longer. /// </summary> internal void SetRecycle() { _recycle.SetTrueIf(false); }