System.Collections.Concurrent.BlockingCollection.Add(MessageState)

Here are the examples of the csharp api class System.Collections.Concurrent.BlockingCollection.Add(MessageState) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: IFramework
Source File: MessageSender.cs
public virtual void Start()
        {
            if (_needMessageStore)
            {
                GetAllUnSentMessages().ForEach(eventContext => _messageStateQueue.Add(new MessageState(eventContext)));
            }
            var cancellationTokenSource = new CancellationTokenSource();
            _sendMessageTask = Task.Factory.StartNew(cs => SendMessages(cs as CancellationTokenSource),
                                                     cancellationTokenSource,
                                                     cancellationTokenSource.Token,
                                                     TaskCreationOptions.LongRunning,
                                                     TaskScheduler.Default);
        }