public PushData(ILogger <PushData> logger, IServiceScopeFactory scopeFactor , IOptions <AppSettings> options, IMsgQueue queue ) { _mcsetting = options.Value.MqttClient; _logger = logger; scope = scopeFactor.CreateScope(); _queue = queue; }
public PushData(ILogger <PushData> logger, IServiceScopeFactory scopeFactor , IOptions <AppSettings> options, IMsgQueue queue, IStorage storage ) { _appSettings = options.Value; _logger = logger; scope = scopeFactor.CreateScope(); _queue = queue; _storage = storage; }
public MQTTServerHandler(ILogger <MQTTServerHandler> logger, IServiceScopeFactory scopeFactor, IMqttServerEx serverEx , IOptions <AppSettings> options, IMsgQueue queue ) { _mcsetting = options.Value.MqttClient; _logger = logger; scope = scopeFactor.CreateScope(); _dbContext = scope.ServiceProvider.GetRequiredService <ApplicationDbContext>(); _serverEx = serverEx; _queue = queue; }
public CoApResource(string name, ApplicationDbContext dbContext, ILogger logger, IMsgQueue queue) : base(name) { Attributes.Title = name; _res = (CoApRes)Enum.Parse(typeof(CoApRes), name); _dbContext = dbContext; foreach (Int32 item in _supported) { Attributes.AddContentType(item); } _logger = logger; _queue = queue; _logger.LogInformation($"CoApResource {name} is created."); }
private void DoSend(string msg) { int i = 0; IMsgQueue <IActor> item = fQueue.TryDequeue().Result; while (item.Result && (i < KSize)) { item.Data.SendMessage("Bop"); item = fQueue.TryDequeue().Result; Console.WriteLine("receive " + i.ToString(CultureInfo.InvariantCulture)); i++; } Console.WriteLine("end " + i.ToString(CultureInfo.InvariantCulture)); }
public DbReceiver(ILog _log, IMsgQueue <byte[]> _msg) { msg = _msg; }
public ClientSocket(ILog _log, IMsgQueue <Msg> _msg, IWebSocket _socket) { msg = _msg; socket = _socket; }
public HostSocket(ILog _log, IMsgQueue <Msg> _msg, IWebSocketConnection _socket) { msg = _msg; socket = _socket; }
public CoAPService(ILogger <CoAPService> logger, IServiceScopeFactory scopeFactor, IOptions <AppSettings> options, IMsgQueue queue) { _settings = options.Value; server = new CoapServer(_settings.CoapServer); _logger = logger; _serviceScope = scopeFactor.CreateScope(); _dbContext = _serviceScope.ServiceProvider.GetRequiredService <ApplicationDbContext>(); Enum.GetNames(typeof(CoApRes)).ToList().ForEach(n => server.Add(new CoApResource(n, _serviceScope.ServiceProvider.GetRequiredService <ApplicationDbContext>(), _logger, queue))); }