Exemple #1
0
        private Task OnLockReleasedAsync(CacheLockReleased msg, CancellationToken cancellationToken = default(CancellationToken))
        {
            _logger.Trace("Got lock released message: {Name}", msg.Name);
            if (_autoResetEvents.TryGetValue(msg.Name, out AsyncAutoResetEvent autoResetEvent))
            {
                autoResetEvent.Set();
            }

            return(Task.CompletedTask);
        }
        private async Task OnLockReleasedAsync(CacheLockReleased msg, CancellationToken cancellationToken = default(CancellationToken)) {
            _logger.Trace("Got lock released message: {Name}", msg.Name);

            AsyncMonitor monitor;
            if (!_monitors.TryGetValue(msg.Name, out monitor))
                return;

            using (await monitor.EnterAsync())
                monitor.Pulse();
        }
        private async Task OnLockReleasedAsync(CacheLockReleased msg, CancellationToken cancellationToken = default(CancellationToken)) {
#if DEBUG
            Logger.Trace().Message($"Got lock released message: {msg.Name}").Write();
#endif
            AsyncMonitor monitor;
            if (!_monitors.TryGetValue(msg.Name, out monitor))
                return;

            using (await monitor.EnterAsync())
                monitor.Pulse();
        }
        private Task OnLockReleasedAsync(CacheLockReleased msg, CancellationToken cancellationToken = default)
        {
            if (_logger.IsEnabled(LogLevel.Trace))
            {
                _logger.LogTrace("Got lock released message: {Name}", msg.Name);
            }
            if (_autoResetEvents.TryGetValue(msg.Name, out var autoResetEvent))
            {
                autoResetEvent.Set();
            }

            return(Task.CompletedTask);
        }
Exemple #5
0
        private async Task OnLockReleasedAsync(CacheLockReleased msg, CancellationToken cancellationToken = default(CancellationToken))
        {
            _logger.Trace("Got lock released message: {Name}", msg.Name);

            AsyncMonitor monitor;

            if (!_monitors.TryGetValue(msg.Name, out monitor))
            {
                return;
            }

            using (await monitor.EnterAsync().AnyContext())
                monitor.Pulse();
        }
        private async Task OnLockReleasedAsync(CacheLockReleased msg, CancellationToken cancellationToken = default(CancellationToken))
        {
#if DEBUG
            Logger.Trace().Message($"Got lock released message: {msg.Name}").Write();
#endif
            AsyncMonitor monitor;
            if (!_monitors.TryGetValue(msg.Name, out monitor))
            {
                return;
            }

            using (await monitor.EnterAsync())
                monitor.Pulse();
        }
Exemple #7
0
 private void OnLockReleased(CacheLockReleased msg)
 {
     Logger.Trace().Message("Got lock released message: {0}", msg.Name).Write();
     AsyncAutoResetEvent autoEvent;
     if (_autoEvents.TryGetValue(msg.Name, out autoEvent)) {
         autoEvent.Set();
     }
 }