public void Configure( IApplicationBuilder application, IHostingEnvironment environment, MqttServerService mqttServerService, PythonScriptHostService pythonScriptHostService, DataSharingService dataSharingService, MqttSettingsModel mqttSettings) { if (environment.IsDevelopment()) { application.UseDeveloperExceptionPage(); } else { application.UseHsts(); } application.UseCors(x => x .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials()); application.UseAuthentication(); application.UseStaticFiles(); application.UseHttpsRedirection(); application.UseMvc(); ConfigureWebSocketEndpoint(application, mqttServerService, mqttSettings); dataSharingService.Configure(); pythonScriptHostService.Configure(); mqttServerService.Configure(); application.UseSwagger(o => o.RouteTemplate = "/api/{documentName}/swagger.json"); application.UseSwaggerUI(o => { o.RoutePrefix = "api"; o.DocumentTitle = "MQTTnet.Server API"; o.SwaggerEndpoint("/api/v1/swagger.json", "MQTTnet.Server API v1"); o.DisplayRequestDuration(); o.DocExpansion(DocExpansion.List); o.DefaultModelRendering(ModelRendering.Model); }); }
public void Configure( IApplicationBuilder application, MqttServerService mqttServerService, PythonScriptHostService pythonScriptHostService, DataSharingService dataSharingService, MqttSettingsModel mqttSettings) { application.UseDefaultFiles(); application.UseStaticFiles(); application.UseHsts(); application.UseRouting(); application.UseCors(x => x .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); application.UseAuthentication(); application.UseAuthorization(); application.UseEndpoints(endpoints => { endpoints.MapControllers(); }); ConfigureWebSocketEndpoint(application, mqttServerService, mqttSettings); dataSharingService.Configure(); pythonScriptHostService.Configure(); mqttServerService.Configure(); application.UseSwagger(o => o.RouteTemplate = "/api/{documentName}/swagger.json"); application.UseSwaggerUI(o => { o.RoutePrefix = "api"; o.DocumentTitle = "MQTTnet.Server API"; o.SwaggerEndpoint("/api/v1/swagger.json", "MQTTnet.Server API v1"); o.DisplayRequestDuration(); o.DocExpansion(DocExpansion.List); o.DefaultModelRendering(ModelRendering.Model); }); }
public async Task TryAddAsync(string key, Task <object> value) => await DataSharingService.GetInstance().AddOrUpdateAsync(key, value, Configuration);
public async Task <object> TryGetValueAsync(string key, int timeoutInMs = DataSharingService.DefaultTimeoutInMs) => await DataSharingService.GetInstance().GetValueAsync(key, Configuration, timeoutInMs);
public void TryAdd(string key, object value) => DataSharingService.GetInstance().AddOrUpdate(key, value, Configuration);
public object TryGetValue(string key, int timeoutInMs = DataSharingService.DefaultTimeoutInMs) => DataSharingService.GetInstance().GetValue(key, Configuration);