Example #1
0
        public ClientsDispatcher(IWebSocketConnectionManager manager, IBackplane backplane, ILogger <ClientsDispatcher> logger)
        {
            Manager   = manager;
            Backplane = backplane;
            _logger   = logger;

            All = new ClientInvoker(
                async(methodName, args) =>
            {
                var message = new Message()
                {
                    MessageType = MessageType.ClientMethodInvocation,
                    Data        = MessageSerializer.SerializeObject(new InvocationDescriptor()
                    {
                        MethodName = methodName,
                        Arguments  = args
                    })
                };
                await Backplane.SendMessageAllAsync(message).ConfigureAwait(false);
            },
                async msg =>
            {
                await Backplane.SendMessageAllAsync(msg).ConfigureAwait(false);
            },
                async group => {
                await Backplane.SubscribeAll(group).ConfigureAwait(false);
            },
                async group => {
                await Backplane.UnsubscribeAll(group).ConfigureAwait(false);
            });
        }
 public void PublishBackplaneMessage(IBackplane backplane)
 {
     backplane.Send(new BackplaneMessage()
     {
         Message = "backplane message"
     });
 }
Example #3
0
 public static Task InvokeGroupAsync(this IBackplane backplane, string groupName, string methodName, params object[] arguments)
 {
     return(backplane.SendMessageGroupAsync(groupName, new Message
     {
         MessageType = MessageType.ClientMethodInvocation,
         Data = MessageSerializer.SerializeObject(new InvocationDescriptor()
         {
             MethodName = methodName,
             Arguments = arguments
         })
     }));
 }
        public OrganisationHierarchyCache(
            ILogger logger,
            IRequestStore requestStore,
            IDateTimeProvider dateTimeProvider,
            IBackplane backplane,
            IConfigurationManager configurationManager
            )
        {
            _logger           = logger;
            _requestStore     = requestStore;
            _dateTimeProvider = dateTimeProvider;
            _backplane        = backplane;

            var timeoutInSeconds = configurationManager.Get("OrganisationCacheTimeout", 0);//zero if not configured, this avoids confusion with things being auto cached.

            _logger.Debug($"{nameof(OrganisationHierarchyCache)}", new LogItem("Event", $"Organisation cache timeout set to {timeoutInSeconds}"));

            _cacheList = new CacheList <Guid, OrganisationHierarchyCacheItem>(GetOrganisationTreeItemForOrganisation, TimeSpan.FromSeconds(timeoutInSeconds), false);
        }
        public RequestStore(
            IDateTimeProvider dateTimeProvider,
            IQueueWrapper queueWrapper,
            ILogger logger,
            IRequestMatcher requestMatcher,
            IConfigurationManager config,
            IBackplane backplane
            )
        {
            this.queueWrapper     = queueWrapper;
            this.logger           = logger;
            this.requestMatcher   = requestMatcher;
            this.dateTimeProvider = dateTimeProvider;

            const int defaultBusTimeoutMilliseconds = 5000;

            busTimeoutMilliseconds = config.Get("BusTimeoutMilliseconds", defaultBusTimeoutMilliseconds);

            this.backplane = backplane;
            Methods        = new List <string>();
        }
 public RoleMessageHandler(IBackplane backplane)
 {
     this.backplane = backplane;
 }
 public MethodInspectorManager(IBackplane backplane, IMessageHashes receivedHashes)
 {
     this.backplane  = backplane;
     _receivedHashes = receivedHashes;
 }
Example #8
0
 public GroupsDispatcher(IBackplane backplane)
 {
     _backplane = backplane;
 }
Example #9
0
 public RequestResponseMessageHandler(IBackplane backplane, ILogger logger, IRequestStore requestStore)
 {
     this.backplane    = backplane;
     _logger           = logger;
     this.requestStore = requestStore;
 }