Ejemplo n.º 1
0
 public void EnlistForRemoval(SimpleQueueMessage message)
 {
     if (message == null)
     {
         throw new ArgumentNullException("message");
     }
     _enlistedForRemoval.Add(message);
 }
        public void Store(SimpleQueueMessage message)
        {
            lock (_lockObject) {
                _filesToIgnoreList.Add(message.MessageId.ToString());
            }

            using (var stream = File.Create(Path.Combine(_metaDirectory.FullName, message.MessageId.ToString()))) {
                Formatter.Serialize(stream, message);
            }
            using (var stream = File.Create(Path.Combine(_dataDirectory.FullName, message.MessageId.ToString()))) {
                Formatter.Serialize(stream, message.Payload);
            }
        }
        private void OnNewMessage(SimpleQueueMessage message)
        {
            var eventHandler = NewMessage;

            if (eventHandler == null)
            {
                return;
            }

            eventHandler(this, new NewMessageEventArgs()
            {
                Message = message
            });
        }
 public void EnlistForRemoval(SimpleQueueMessage message)
 {
     if (message == null) throw new ArgumentNullException("message");
       _enlistedForRemoval.Add(message);
 }
 public object GetData(SimpleQueueMessage message)
 {
     using (var stream = File.OpenRead(Path.Combine(_dataDirectory.FullName, message.MessageId.ToString()))) {
         return(Formatter.Deserialize(stream));
     }
 }
 public void RemoveMessage(SimpleQueueMessage message)
 {
     File.Delete((Path.Combine(_metaDirectory.FullName, message.MessageId.ToString())));
     File.Delete((Path.Combine(_dataDirectory.FullName, message.MessageId.ToString())));
 }
        public void Store(SimpleQueueMessage message)
        {
            lock (_lockObject) {
            _filesToIgnoreList.Add(message.MessageId.ToString());
              }

              using (var stream = File.Create(Path.Combine(_metaDirectory.FullName, message.MessageId.ToString()))) {
            Formatter.Serialize(stream, message);
              }
              using (var stream = File.Create(Path.Combine(_dataDirectory.FullName, message.MessageId.ToString()))) {
            Formatter.Serialize(stream, message.Payload);
              }
        }
 public void RemoveMessage(SimpleQueueMessage message)
 {
     File.Delete((Path.Combine(_metaDirectory.FullName, message.MessageId.ToString())));
       File.Delete((Path.Combine(_dataDirectory.FullName, message.MessageId.ToString())));
 }
 public object GetData(SimpleQueueMessage message)
 {
     using (var stream = File.OpenRead(Path.Combine(_dataDirectory.FullName, message.MessageId.ToString()))) {
     return Formatter.Deserialize(stream);
       }
 }
        private void OnNewMessage(SimpleQueueMessage message)
        {
            var eventHandler = NewMessage;

              if (eventHandler == null)
            return;

              eventHandler(this, new NewMessageEventArgs() { Message = message });
        }