public Application(
            IExecutionOrderBookRepository executionOrderBookRepository,
            ILog logger,
            Settings settings,
            CurrentApplicationInfo applicationInfo,
            ISlackNotificationsSender slackNotificationsSender)
            : base(logger, slackNotificationsSender, applicationInfo, MessageFormat.MessagePack)
        {
            _executionOrderBookRepository = executionOrderBookRepository;
            _log      = logger;
            _settings = settings;

            _retryPolicy = Policy
                           .Handle <Exception>()
                           .WaitAndRetryAsync(new[]
            {
                TimeSpan.FromSeconds(1),
                TimeSpan.FromSeconds(2),
                TimeSpan.FromSeconds(4),
                TimeSpan.FromSeconds(8),
            }, onRetry: (exception, timespan, retryCount, context) =>
            {
                _log.WriteWarningAsync(nameof(ExecutionOrderBookBroker), nameof(HandleMessage),
                                       $"Cannot save orderBookMessage with order id {context["id"]}, external order id {context["externalOrderId"]}, retryCount {retryCount}",
                                       exception);
            });
        }
예제 #2
0
 public Application(
     IExecutionOrderBookRepository executionOrderBookRepository,
     ILog logger,
     Settings settings,
     CurrentApplicationInfo applicationInfo,
     ISlackNotificationsSender slackNotificationsSender)
     : base(logger, slackNotificationsSender, applicationInfo, MessageFormat.MessagePack)
 {
     _executionOrderBookRepository = executionOrderBookRepository;
     _log      = logger;
     _settings = settings;
 }
예제 #3
0
 public ExecutionOrderBooksProviderService(
     IExecutionOrderBookRepository executionOrderBookRepository)
 {
     _executionOrderBookRepository = executionOrderBookRepository;
 }