Пример #1
0
            public ConsumerActionWrapper(String consumerId, Func <IChunk, Task> consumerAction, CommitPollingClient2 owner)
            {
                _consumerAction = consumerAction;
                _active         = true;
                _owner          = owner;
                _consumerId     = consumerId;

                HealthChecks.RegisterHealthCheck("PollingConsumer-" + consumerId, () =>
                {
                    if (string.IsNullOrEmpty(_error))
                    {
                        return(HealthCheckResult.Healthy($"Consumer {_consumerId} healthy"));
                    }

                    return(HealthCheckResult.Unhealthy($"Consumer {_consumerId} error: " + _error));
                });
            }
 public ConsumerActionWrapper(Action <ICommit> consumerAction, CommitPollingClient2 owner)
 {
     _consumerAction = consumerAction;
     _active         = true;
     _owner          = owner;
 }