Ejemplo n.º 1
0
        public AbstractPeerService(TInfo info, ICacheClient cacheClient, IMessageBusFactory messageBusFactory)
        {
            Info               = info;
            _cacheClient       = cacheClient;
            _messageBusFactory = messageBusFactory;

            MessageBus = messageBusFactory.Build($"{Scopes.PeerMessaging}:{info.Name}");

            _peerMessageBus = messageBusFactory.Build(Scopes.PeerDiscovery);
            _peers          = new ConcurrentDictionary <string, PeerServiceInfoEntry>();
        }
Ejemplo n.º 2
0
 public Task SendMessage <T>(PeerServiceInfo info, T message) where T : class
 => _messageBusFactory
 .Build($"{Scopes.PeerMessaging}:{info.Name}")
 .PublishAsync <T>(message);