Esempio n. 1
0
        public QueueMessage WithFlags(QueueMessageFlags flags)
        {
            var clone = this.Clone();

            clone.Flags = flags;
            return(clone);
        }
Esempio n. 2
0
 public static QueueMessage Create(object data, string commandType, QueueMessageFlags flags = null)
 {
     flags = flags ?? QueueMessageFlags.NormalPriority;
     return(new QueueMessage()
     {
         CommandType = commandType,
         Data = data,
         Flags = flags
     });
 }
Esempio n. 3
0
        public QueueMessage(QueueMessageFlags flags, string commandType, object data, string lockIdentifier)
        {
            this.CommandType    = commandType;
            this.Flags          = flags;
            this.Data           = data;
            this.LockIdentifier = lockIdentifier;

            if (string.IsNullOrWhiteSpace(this.LockIdentifier))
            {
                this.LockIdentifier = Environment.GetEnvironmentVariable("APPLICATION_INSTANCE_ID");

                if (string.IsNullOrWhiteSpace(this.LockIdentifier))
                {
                    this.LockIdentifier = Environment.MachineName;
                }
            }
        }