コード例 #1
0
        public async Task Subscribe(string eventName, string apiKey)
        {
            var(ok, serviceName) = await _keyStore.Validate(apiKey);

            if (!ok)
            {
                throw new HubException("Api Key Validation Failed");
            }

            _logger.LogInformation($"Subscribe: {serviceName} -- {eventName}");
            await Groups.AddToGroupAsync(Context.ConnectionId, eventName);

            await _connectionManager.AddToGroup(Context.ConnectionId, eventName);
        }