public HttpRequestHandler( IContextHolder contextHolder, IResponseMapper <TIntent, TOutput> responseMapper) { _contextHolder = contextHolder; _responseMapper = responseMapper; }
public FilesController(ILogger <FilesController> logger, IHostingEnvironment environment, IContextHolder contextHolder) { _logger = logger; _environment = environment; _contextHolder = contextHolder; _mu = new MuPdf(); }
public void CopyTo(IContextHolder destination) { foreach (var item in _contextItems) { destination.Context.SetValue((string)item.Key, item.Value); } }
public PgConnectionFactory(IContextHolder contextHolder) { _contextHolder = contextHolder; DatabaseConfig pgConfig = contextHolder.Config.Persistence.Postgres; // validate config if (string.IsNullOrEmpty(pgConfig.Host)) { throw new Exception("Postgres configuration: invalid or missing 'host'"); } if (pgConfig.Port == 0) { throw new Exception("Postgres configuration: invalid or missing 'port'"); } if (string.IsNullOrEmpty(pgConfig.Database)) { throw new Exception("Postgres configuration: invalid or missing 'database'"); } if (string.IsNullOrEmpty(pgConfig.User)) { throw new Exception("Postgres configuration: invalid or missing 'user'"); } // build connection string _connectionString = $"Server={pgConfig.Host};Port={pgConfig.Port};Database={pgConfig.Database};User Id={pgConfig.User};Password={pgConfig.Password};CommandTimeout=900;"; }
public void TestGetKill() { IContextHolder holder = NoContextHolder.Instance; CheckGet(holder); holder.KillContext(); CheckGet(holder); }
public static void ExpectGetContext(this IContextHolder mock, IInternalContainer worker, IInjectionContext result) { Expect.Once.On(mock) .Method("GetContext") .With(worker) .Will(Return.Value(result)); }
public ExchangeRateUpdater(IJobManager jobManager, IExchangeRateProvider exchangeRateProvider, IContextHolder contextHolder) { _jobManager = jobManager; _exchangeRateProvider = exchangeRateProvider; _contextHolder = contextHolder; LastExecuted = DateTime.Now.AddSeconds(-RepetitionIntervalInSeconds * 2); _jobManager.Add(this); }
public PricingHub( IPriceLastValueCache priceLastValueCache, ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder) { _priceLastValueCache = priceLastValueCache; _currencyPairRepository = currencyPairRepository; _contextHolder = contextHolder; }
protected void CheckGet(IContextHolder holder) { var internalContainerMock = GetMock <IInternalContainer>(); internalContainerMock.Setup(c => c.CreateNewLog()).Returns((IGroboContainerLog)null); var context = holder.GetContext(internalContainerMock.Object); Assert.That(context, Is.InstanceOf <InjectionContext>()); Assert.That(((InjectionContext)context).ThreadId, Is.EqualTo(Thread.CurrentThread.ManagedThreadId)); }
protected static void CheckGet(IContextHolder holder) { var container = GetMock <IInternalContainer>(); container.Expect(c => c.CreateNewLog()).Return(null); var context = holder.GetContext(container); Assert.That(context, Is.InstanceOf <InjectionContext>()); Assert.That(((InjectionContext)context).ThreadId, Is.EqualTo(Thread.CurrentThread.ManagedThreadId)); }
public DaemonClientFactory(IContextHolder contextHolder, JsonSerializerSettings jsonSerializerSettings) { _coinClientMap = new ConcurrentDictionary <CoinType, DaemonClient>(); if (null != contextHolder.Config.Coins && contextHolder.Config.Coins.Length > 0) { foreach (CoinConfig config in contextHolder.Config.Coins) { DaemonClient coinClient = new DaemonClient(jsonSerializerSettings, config.WalletPassword); coinClient.Configure(config.Daemons); _coinClientMap[config.Type] = coinClient; } } }
public ExchangeService(IContextHolder contextHolder, ITransferRequestRepository iTransferRequestRepository, IConnectionFactory iConnectionFactory, JsonSerializerSettings jsonSerializerSettings, DaemonClientFactory daemonClientFactory, PayoutManager payoutManager, IJobManager jobManager) { _contextHolder = contextHolder; _iTransferRequestRepository = iTransferRequestRepository; _iConnectionFactory = iConnectionFactory; _jsonSerializerSettings = jsonSerializerSettings; _daemonClientFactory = daemonClientFactory; _payoutManager = payoutManager; _jobManager = jobManager; }
public NotificationService(IContextHolder contextHolder, JsonSerializerSettings jsonSerializerSettings) { _contextHolder = contextHolder; _jsonSerializerSettings = jsonSerializerSettings; _httpClient = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip }); if (contextHolder.Config.Notifications?.Enabled == true) { _queue = new BlockingCollection <QueuedNotification>(); _queueSub = _queue.GetConsumingEnumerable() .ToObservable(TaskPoolScheduler.Default) .Select(notification => Observable.FromAsync(() => SendNotificationAsync(notification))) .Concat() .Subscribe(); } }
public PayoutManager(IJobManager jobManager, IContextHolder contextHolder, ITransferRequestRepository iTransferRequestRepository, ITransferRepository iTransferRepository, IConnectionFactory iConnectionFactory, JsonSerializerSettings jsonSerializerSettings, DaemonClientFactory daemonClientFactory, NotificationService notificationService) { _jobManager = jobManager; _contextHolder = contextHolder; _iTransferRequestRepository = iTransferRequestRepository; _iTransferRepository = iTransferRepository; _iConnectionFactory = iConnectionFactory; _jsonSerializerSettings = jsonSerializerSettings; _daemonClientFactory = daemonClientFactory; _notificationService = notificationService; _updatingThroughput = false; LastExecuted = DateTime.Now.AddSeconds(-RepetitionIntervalInSeconds * 2); _jobManager.Add(this); }
public ReferenceDataHub(ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder) { _currencyPairRepository = currencyPairRepository; _contextHolder = contextHolder; }
public TickerHubPublisher(IContextHolder contextHolder, ITickerRepository tickerRepository) { this.contextHolder = contextHolder; this.tickerRepository = tickerRepository; }
public FilesPanelViewComponent(ILogger <FilesController> logger, IContextHolder contextHolder) { _logger = logger; _contextHolder = contextHolder; }
public BreadcrumbsViewComponent(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public TaskDetailsController(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public TickerHub(ITickerRepository tickerRepository, IContextHolder contextHolder) { this.tickerRepository = tickerRepository; this.contextHolder = contextHolder; }
public AnalyticsHub(IContextHolder contextHolder, IAnalyticsService analyticsService) { _contextHolder = contextHolder; _analyticsService = analyticsService; }
public UnitOfWorkMock(Mock <ISessionFactory> sessionFactoryMock, IContextHolder contextHolder) : base(sessionFactoryMock.Object, contextHolder) { SessionFactoryMock = sessionFactoryMock; }
public HomeController(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public FilesController(IContextHolder contextHolder, IStore store, IDocumentRender render) { _contextHolder = contextHolder; _store = store; _render = render; }
public PricePublisher(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public BlotterPublisher(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public AccountController(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public AgentHealthScanPublisher(IContextHolder contextHolder) { this.contextHolder = contextHolder; }
public AnalyticsPublisher(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public BlotterHub(ITradeRepository tradeRepository, IContextHolder contextHolder) { _tradeRepository = tradeRepository; _contextHolder = contextHolder; }
public FileDetailsViewComponent(IContextHolder contextHolder, IDocumentRender render, IStore store) { _contextHolder = contextHolder; _render = render; _store = store; }
public AccountController(ILogger <FilesController> logger, IContextHolder contextHolder) { _logger = logger; _contextHolder = contextHolder; }
public SidePanelViewComponent(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public CurrencyPairUpdatePublisher(IContextHolder contextHolder) { _contextHolder = contextHolder; }
public Container(IInternalContainer internalContainer, IContextHolder holder, IGroboContainerLog currentLog) { this.internalContainer = internalContainer; this.holder = holder; lastConstructedLog = currentLog; }