本文整理匯總了C#中RabbitMQ.Client.Impl.Command類的典型用法代碼示例。如果您正苦於以下問題:C# Command類的具體用法?C# Command怎麽用?C# Command使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Command類屬於RabbitMQ.Client.Impl命名空間,在下文中一共展示了Command類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnCommandReceived
public virtual void OnCommandReceived(Command cmd)
{
CommandHandler handler = CommandReceived;
if (handler != null)
{
handler(this, cmd);
}
}
示例2: CreateConnectionClose
public override void CreateConnectionClose(ushort reasonCode,
string reasonText,
out Command request,
out int replyClassId,
out int replyMethodId)
{
request = new Command(new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionClose(reasonCode,
reasonText,
0, 0));
replyClassId = RabbitMQ.Client.Framing.Impl.v0_9.ConnectionCloseOk.ClassId;
replyMethodId = RabbitMQ.Client.Framing.Impl.v0_9.ConnectionCloseOk.MethodId;
}
示例3: HandleCommand
public void HandleCommand(ISession session, Command cmd)
{
if (DispatchAsynchronous(cmd))
{
// Was asynchronous. Already processed. No need to process further.
}
else
{
m_continuationQueue.Next().HandleCommand(cmd);
}
}
示例4: CanSendWhileClosed
public override bool CanSendWhileClosed(Command cmd)
{
return cmd.m_method is RabbitMQ.Client.Framing.Impl.v0_9.ChannelCloseOk;
}
示例5: HandleCommand
public virtual void HandleCommand(Command cmd)
{
m_cell.Value = Either.Left(cmd);
}
示例6: CreateConnectionClose
///<summary>Used when a connection is being quiesced because
///of a HardProtocolException or Application initiated shutdown</summary>
public abstract void CreateConnectionClose(ushort reasonCode,
string reasonText,
out Command request,
out int replyClassId,
out int replyMethodId);
示例7: CanSendWhileClosed
///<summary>Used in the quiescing session to determine if the command
///is allowed to be sent.</summary>
public abstract bool CanSendWhileClosed(Command cmd);
示例8: TransmitAndEnqueue
public void TransmitAndEnqueue(Command cmd, IRpcContinuation k)
{
Enqueue(k);
try
{
m_session.Transmit(cmd);
}
catch (AlreadyClosedException)
{
// Ignored, since the continuation will be told about
// the closure via an OperationInterruptedException because
// of the shutdown event propagation.
}
}
示例9: HandleCommand
public void HandleCommand(ISession session, Command cmd)
{
m_delegate.HandleCommand(session, cmd);
}
示例10: DispatchAsynchronous
public bool DispatchAsynchronous(Command cmd)
{
return m_delegate.DispatchAsynchronous(cmd);
}
示例11: Transmit
public virtual void Transmit(Command cmd)
{
lock (m_shutdownLock)
{
if (m_closeReason != null)
{
if (!m_connection.Protocol.CanSendWhileClosed(cmd))
throw new AlreadyClosedException(m_closeReason);
}
// We transmit *inside* the lock to avoid interleaving
// of frames within a channel.
cmd.Transmit(m_channelNumber, m_connection);
}
}
示例12: Transmit
public override void Transmit(Command cmd)
{
lock(m_closingLock)
{
if (!m_closing)
{
base.Transmit(cmd);
return;
}
}
// Allow always for sending close ok
// Or if application initiated, allow also for sending close
MethodBase method = cmd.m_method;
if ( ((method.ProtocolClassId == m_closeOkClassId)
&& (method.ProtocolMethodId == m_closeOkMethodId))
|| (!m_closeServerInitiated && (
(method.ProtocolClassId == m_closeClassId) &&
(method.ProtocolMethodId == m_closeMethodId))
))
{
base.Transmit(cmd);
return;
}
}
示例13: CreateConnectionClose
public void CreateConnectionClose(ushort reasonCode,
string reasonText,
out Command request,
out int replyClassId,
out int replyMethodId)
{
request = new Command(new Impl.ConnectionClose(reasonCode,
reasonText,
0, 0));
replyClassId = Impl.ConnectionCloseOk.ClassId;
replyMethodId = Impl.ConnectionCloseOk.MethodId;
}
示例14: CanSendWhileClosed
public bool CanSendWhileClosed(Command cmd)
{
return cmd.Method is Impl.ChannelCloseOk;
}
示例15: TransmitAndEnqueue
public void TransmitAndEnqueue(Command cmd, IRpcContinuation k)
{
Enqueue(k);
m_session.Transmit(cmd);
}