public ExternalTaskWorker <TPayload, TResult> SubscribeToExternalTasksWithTopic <TPayload, TResult>( string topic, HandleExternalTaskAction <TPayload, TResult> handleAction ) where TPayload : new() where TResult : new() { var maxTasks = 10; var timeout = 1000; return(this.SubscribeToExternalTasksWithTopic <TPayload, TResult>(topic, maxTasks, timeout, handleAction)); }
public ExternalTaskWorker <TPayload, TResult> SubscribeToExternalTasksWithTopic <TPayload, TResult>( string topic, int maxTasks, int timeout, HandleExternalTaskAction <TPayload, TResult> handleAction ) where TPayload : new() where TResult : new() { var externalTaskWorker = new ExternalTaskWorker <TPayload, TResult>(this.processEngineUrl, this.Identity, topic, maxTasks, timeout, handleAction); externalTaskWorker.Start(); return(externalTaskWorker); }
/// <summary> /// Creates an new instance of ExternalTaskWorker /// </summary> public ExternalTaskWorker( string processEngineUrl, IIdentity identity, string topic, int maxTasks, int longpollingTimeout, HandleExternalTaskAction <TExternalTaskPayload, TResultPayload> processingFunction ) { this.ProcessEngineUrl = processEngineUrl; this.Identity = identity; this.Topic = topic; this.MaxTasks = maxTasks; this.LongpollingTimeout = longpollingTimeout; this.ProcessingFunction = processingFunction; this.Initialize(); }