Inheritance: ITaskParticipant
コード例 #1
0
ファイル: TaskSupervisor.cs プロジェクト: zzms/MassTransit
        public ITaskParticipant CreateParticipant(string tag)
        {
            if (_stoppingToken.IsCancellationRequested)
                throw new OperationCanceledException("The supervisor is stopping, no additional participants can be created");

            var id = Interlocked.Increment(ref _nextId);

            var participant = new TaskParticipant(tag, () => RemoveParticipant(id));
            lock (_participants)
            {
                _participants.Add(id, participant);
            }

            return participant;
        }
コード例 #2
0
ファイル: TaskSupervisor.cs プロジェクト: xinxinQ/MassTransit
        public ITaskParticipant CreateParticipant(string tag)
        {
            if (_stoppingToken.IsCancellationRequested)
                throw new OperationCanceledException("The supervisor is stopping, no additional participants can be created");

            long id = Interlocked.Increment(ref _nextId);

            var participant = new TaskParticipant(tag, () => RemoveParticipant(id));
            lock (_participants)
            {
                _participants.Add(id, participant);
            }

            return participant;
        }
コード例 #3
0
        public ITaskParticipant CreateParticipant(string tag)
        {
            if (_stoppingToken.IsCancellationRequested)
            {
                throw new OperationCanceledException("The supervisor is stopping, no additional participants can be created");
            }

            var participant = new TaskParticipant(tag);

            lock (_participants)
            {
                _participants.Add(participant);
            }

            return(participant);
        }