public TryToGetOp(TimeSpan sleepTimeBetweenChecks, IMessagingClient messageClient, IConfiguration configuration, ILogging logging) { _sleepTimeBetweenChecks = sleepTimeBetweenChecks; _messageClient = messageClient; _clientConfiguration = configuration.LoadClientConfiguration(); _logging = logging; }
private static void RegisterBehaviours(IBehaviour behaviour, IMessagingClient client) { foreach (var handler in behaviour.GetMessageReceivedBehaviours()) { client.RegisterEventHandler(handler.EventType, handler.EventHandler); } }
private static void StartOpGetterThread(IMessagingClient client, IConfiguration configuration, ILogging logging) { // Zusätzlichen Thread starten, der regelmäßig prüft, ob der TopicBot OP hat, und falls nicht, den Channel verlässt und neu beitritt, // sobald er der einzige User im Channel ist (um so OP zu bekommen) var opGetter = new TopicBotBehaviour.TryToGetOp(new TimeSpan(0, 3, 0), client, configuration, logging); new Thread(new ThreadStart(opGetter.CheckIfOpAndTryToGetOpIfNotLoop)).Start(); }
public TournamentPlayer(IMessagingClient client, ConfigurationProposal configProposal, IWorldState preferredWorldState) { this.client = client; this.configProposal = configProposal; this.preferredWorldState = preferredWorldState; }
private static void StartOpGetterThread(IMessagingClient client, IConfiguration configuration, ILogging logging) { // Zusätzlichen Thread starten, der regelmäßig prüft, ob der TopicBot OP hat, und falls nicht, den Channel verlässt und neu beitritt, // sobald er der einzige User im Channel ist (um so OP zu bekommen) var opGetter = new TopicBotBehaviour.TryToGetOp(new TimeSpan(0, 3, 0), client, configuration, logging); new Thread(new ThreadStart(opGetter.CheckIfOpAndTryToGetOpIfNotLoop)).Start(); }
/// <summary> /// Initializes a new instance of <see cref="DefaultWtlpClient" /> /// </summary> /// <param name="messagingClient">The underlying messaging client used for communication</param> /// <param name="recipient">The recipient to receive messages from and send messages to</param> public DefaultWtlpClient(IMessagingClient messagingClient, string recipient) { //set messagingClient and recipient this.Recipient = recipient; this.MessagingClient = messagingClient; //subscribe to events from the messaging client //this.MessagingClient.MessageReceived += MessagingClient_MessageReceived; }
public HazelcastHealthCheck(IMessagePublisher messagePublisher, IMessagingClient messagingClient, HazelcastConfig configuration) { this.messagePublisher = messagePublisher; this.messagingClient = messagingClient; this.configuration = configuration; this.hzInstance = GetHazelcastInstance(); }
public PizzaFulfillmentProcess(IMessagingClient messageClient, ILogger <PizzaFulfillmentProcess> log) { _log = log; _messageClient = messageClient; this.MapIdFor <PizzaOrderedEvent>((m, md) => m.OrderId); this.MapIdFor <PizzaPaidForEvent>((m, md) => m.OrderId); this.MapIdFor <PizzaPreparedEvent>((m, md) => m.OrderId); this.MapIdFor <PizzaDeliveredEvent>((m, md) => m.OrderId); }
public ProfileController( IHostEnvironment env, IMessagingClient messagingClient, IMapper mapper, IEvacuationSearchService evacuationSearchService, IProfileInviteService profileInviteService) { this.env = env; this.messagingClient = messagingClient; this.mapper = mapper; this.evacuationSearchService = evacuationSearchService; this.profileInviteService = profileInviteService; }
void DisposeMessageHandling() { if (messagingClient != null) { messagingClient.Dispose(); messagingClient = null; } if (messageTransport != null) { messageTransport.Dispose(); messageTransport = null; } }
public async Task SetupMqtt() { var options = new ManagedMqttClientOptionsBuilder() .WithAutoReconnectDelay(TimeSpan.FromSeconds(5)) .WithClientOptions(new MqttClientOptionsBuilder() .WithClientId(_settings.ClientId) .WithCredentials(_settings.Username, _settings.UserPassword) .WithTcpServer(_settings.Server) .WithProtocolVersion(MQTTnet.Formatter.MqttProtocolVersion.V500) .Build()) .Build(); var messagingClient = new MqttMessagingClient(_settings, new MqttFactory().CreateManagedMqttClient()); await messagingClient.InternalClient.StartAsync(options); MessagingClient = messagingClient; }
public RegistrationsTests() { mapper = new MapperConfiguration(cfg => { cfg.AddMaps(typeof(Startup)); }).CreateMapper(); messagingClient = A.Fake <IMessagingClient>(); //Handle RegistrantsSearchQuery A.CallTo(() => messagingClient.Send(A <RegistrantsSearchQuery> .That.IsNotNull())) .ReturnsLazily(o => { var query = o.GetArgument <RegistrantsSearchQuery>(0); IEnumerable <KeyValuePair <string, RegistrantWithFiles> > ret = stagedRegistrantsWithFiles.Where(a => true); if (!string.IsNullOrEmpty(query.Id)) { ret = ret.Where(r => r.Value.RegistrantProfile.Id == query.Id); } if (!string.IsNullOrEmpty(query.UserId)) { ret = ret.Where(r => r.Value.RegistrantProfile.UserId == query.UserId); } if (!string.IsNullOrEmpty(query.FirstName)) { ret = ret.Where(r => r.Value.RegistrantProfile.FirstName.Equals(query.FirstName, StringComparison.OrdinalIgnoreCase)); } if (!string.IsNullOrEmpty(query.LastName)) { ret = ret.Where(r => r.Value.RegistrantProfile.LastName.Equals(query.LastName, StringComparison.OrdinalIgnoreCase)); } if (!string.IsNullOrEmpty(query.DateOfBirth)) { ret = ret.Where(r => r.Value.RegistrantProfile.DateOfBirth.Equals(query.DateOfBirth, StringComparison.OrdinalIgnoreCase)); } return(Task.FromResult(new RegistrantsSearchQueryResult { Items = ret.Select(r => r.Value) })); }); }
public ContainerHostClient(IProcess hostProcess, IMessageTransport messageTransport, IMessagingClient messagingClient, JobObject containerJobObject) { this.hostProcess = hostProcess; this.messageTransport = messageTransport; this.messagingClient = messagingClient; this.containerJobObject = containerJobObject; this.hostProcess.Exited += (o, e) => { Exited.Invoke(this, e); // TODO: If the host process dies (or is killed) we should shutdown the container. //OnHostStopped(hostProcess != null && hostProcess.HasExited ? hostProcess.ExitCode : 0); DisposeMessageHandling(); }; this.messagingClient.SubscribeEvent <ProcessDataEvent>("processData", HandleProcessData); }
public TeamCommunitiesAssignmentsController(IMessagingClient messagingClient) { this.messagingClient = messagingClient; }
public Behaviour(IMessagingClient messageClient) { _messageClient = messageClient; }
public EvacuationSearchService(IMessagingClient messagingClient, IMapper mapper, IHttpContextAccessor httpContext) { this.messagingClient = messagingClient; this.mapper = mapper; this.httpContext = httpContext; }
public Function(IMessagingClient client, INotificationRepository notificationRepository, ILogger <Function> logger) { this.Client = client; this.Logger = logger; this.Repository = notificationRepository; }
public BSSNotification(IMessagingClient client) { this.Client = client; }
/// <summary> /// Sends a request asynchronously to associated message handler and expects an object in respond. /// </summary> /// <remarks> /// Request-response behavior. /// </remarks> public static async Task <TResponse> Request <TResponse>(this IMessagingClient client, IMessage <TResponse> message, CancellationToken token = default) => (TResponse)await client.RequestObject(message, token);
public TeamMembersController(IMessagingClient client, IMapper mapper) { this.client = client; this.mapper = mapper; }
private const int cacheDuration = 5 * 60; //5 minutes public ConfigurationController(IConfiguration configuration, IMessagingClient client, IMapper mapper) { this.configuration = configuration; this.client = client; this.mapper = mapper; }
public StatusUpdate(INotificationRepository notificationRepository, INotifyGateway notifyGateway, IMessagingClient client) { this.NotificationRepository = notificationRepository; this.NotifyGateway = notifyGateway; this.Client = client; }
/// <summary> /// Sends a message object asynchronously to associated message handler without waiting for a response. /// </summary> /// <remarks> /// Fire-and-forget behavior. /// </remarks> public static Task Publish(this IMessagingClient client, IMessage message, CancellationToken token = default) => client .PublishObject(message, token);
public FailoverMessagingClient(IMessagingClient primaryClient, IMessagingClient secondaryClient) { this.primaryClient = primaryClient; this.secondaryClient = secondaryClient; }
public UserService(IMessagingClient messagingClient, ICache cache, ILogger <UserService> logger) { this.messagingClient = messagingClient; this.cache = cache; this.logger = logger; }
public ProfileInviteService(IMessagingClient messagingClient, ILogger <ProfileInviteService> logger) { this.messagingClient = messagingClient; this.logger = logger; }
public BaseRequestHandler() { this.messagingClient = new EasyNetQMessagingClient(); this.messagingClient.Subscribe <T>(HandleRequest); }
public OrganisationsController(INotificationRepository repository, IMessagingClient client, IConfiguration configuration) { this.IsResetEnabled = configuration.GetValue <bool>("EnableReset"); this.Repository = repository; this.Client = client; }
public ChannelMessageActions(IMessagingClient messagingClient) { _messagingClient = messagingClient; }
public SoloNetworkControllerFactory(IMessagingClient client) { this.client = client; }
public EvacuationSearchService(IMessagingClient messagingClient) { this.messagingClient = messagingClient; }
public TasksController(IMessagingClient messagingClient, IMapper mapper, ILogger <TasksController> logger) { this.messagingClient = messagingClient; this.mapper = mapper; this.logger = logger; }
public EvacuationSearchService(IMessagingClient messagingClient, IMapper mapper) { this.messagingClient = messagingClient; this.mapper = mapper; }
public SuppliersController(IMessagingClient messagingClient, IMapper mapper) { this.messagingClient = messagingClient; this.mapper = mapper; }
/// <summary> /// Sends a request asynchronously to associated message handler expecting successful request handling only. /// </summary> /// <remarks> /// Request-response behavior. /// </remarks> public static Task Request(this IMessagingClient client, IMessage message, CancellationToken token = default) => client .Request <None>(message, token);
public EvacuationSearchService(IMessagingClient messagingClient, IMapper mapper, IConfiguration configuration) { this.messagingClient = messagingClient; this.mapper = mapper; this.configuration = configuration; }
public EvacuationsController(IMessagingClient messagingClient, IMapper mapper, IEvacuationSearchService evacuationSearchService) { this.messagingClient = messagingClient; this.mapper = mapper; this.evacuationSearchService = evacuationSearchService; }
public ReportsController(IMessagingClient messagingClient) { this.messagingClient = messagingClient; }