Exemplo n.º 1
0
        /// <summary>
        /// Constructs a new TaskRunnerInformationBase.
        /// </summary>
        /// <param name="tenantId"></param>
        /// <param name="connectorConfigId"></param>
        /// <param name="function"></param>
        /// <param name="exceptionHandler"></param>
        /// <param name="repeatedTaskFailureTimeHandler"></param>
        /// <param name="cancellationToken"></param>
        public TaskRunnerInformationBase(Guid tenantId, Guid connectorConfigId, Func <Task> function, ExceptionHandlerFunction exceptionHandler, RepeatedTaskFailureTimeFunction repeatedTaskFailureTimeHandler, CancellationToken cancellationToken)
        {
            TenantId          = tenantId;
            ConnectorConfigId = connectorConfigId;
            Function          = function;
            ExceptionHandler  = exceptionHandler;
            RepeatedTaskFailureTimeHandler = repeatedTaskFailureTimeHandler;
            CancellationToken = cancellationToken;

            LogPrefix = $"CorrelationId [{CorrelationId}] for ConnectorConfigId [{ConnectorConfigId}] TenantId [{TenantId}]";
        }
Exemplo n.º 2
0
 public TaskRunnerInformation(Guid tenantId, Guid connectorConfigId, Func <Task> function, ExceptionHandlerFunction exceptionHandler, RepeatedTaskFailureTimeFunction repeatedTaskFailureTimeHandler, T taskObject, CancellationToken cancellationToken)
     : base(tenantId, connectorConfigId, function, exceptionHandler, repeatedTaskFailureTimeHandler, cancellationToken)
 {
     TaskObject = taskObject;
 }
 private TaskRunnerInformationBase GetTaskRunnerInformation <T>(Func <Task> code, ExceptionHandlerFunction exceptionHandler, RepeatedTaskFailureTimeFunction taskFailureAllowanceTimeHandler, T taskObject, CancellationToken ct)
     where T : new()
 {
     return(new TaskRunnerInformation <T>(
                Guid.NewGuid(),
                Guid.NewGuid(),
                code,
                exceptionHandler,
                taskFailureAllowanceTimeHandler,
                taskObject,
                ct));
 }