コード例 #1
0
 internal static void LogAction(MessageState state, string message)
 {
     if ((int)state < 100)
     {
         QLogger.Info("State:{0}, Message:{1}", state.ToString(), message);
     }
     else
     {
         QLogger.Error("State:{0}, Message:{1}", state.ToString(), message);
     }
 }
コード例 #2
0
ファイル: Message.cs プロジェクト: nistec/MQueue
 public static QueueItem Ack(MessageState state, QueueCmd cmd, Exception ex)
 {
     return(new QueueItem()
     {
         Command = cmd,
         Label = ex == null?state.ToString() : ex.Message,
                     MessageState = state
     });
 }
コード例 #3
0
ファイル: Message.cs プロジェクト: nistec/MQueue
 public static QueueItem Ack(MessageState state, QueueCmd cmd)
 {
     return(new QueueItem()
     {
         Command = cmd,
         Label = state.ToString(),
         MessageState = state
     });
 }
コード例 #4
0
        public Task UpdateMessageState(NpgsqlConnection connection, Guid queueMessageId, string stateDescription, MessageState messageState)
        {
            var sql = $"UPDATE {_schemaName}.queuemessages " +
                      " SET state =:messageState, Updated = clock_timestamp(), StateDescription = :stateDescription " +
                      " WHERE queuemessageid = :queueMessageId";

            return(connection.QueryAsync(sql, new
            {
                messageState = messageState.ToString(),
                stateDescription,
                queueMessageId
            }));
        }
コード例 #5
0
ファイル: MessageAckServer.cs プロジェクト: nistec/MQueue
        public static void WriteAck(Stream pipeStream, MessageState state, QueueCmd cmd, string label)
        {
            if (pipeStream == null)
            {
                throw new MessageException(MessageState.PipeError, "Invalid stream to write ack");
            }
            string lbl = label == null?state.ToString() : label;

            QueueItem response = QueueItem.Ack(state, cmd, lbl, null);

            using (NetStream stream = new NetStream())
            {
                response.EntityWrite(stream, null);
                WriteReponse(pipeStream, stream.ToArray());
            }

            QLogger.Debug("Server Ack State:{0}, Label: {1}", state, label);
        }
コード例 #6
0
 void changeMessageInc()
 {
     Debug.Log("changeMessage from" + m.ToString("F") + " to " + (++m).ToString("F"));
 }
コード例 #7
0
 void changeMessage(MessageState ms)
 {
     m = ms;
     Debug.Log("Message is " + m.ToString("F"));
 }