/// <summary> /// Enqueue an item to the queue, will block if the queue is full. /// </summary> /// <param name="value"></param> public void Enqueue(T value) { m_queue.Enqueue(value); var msg = new Msg(); msg.InitGC(EmptyArray <byte> .Instance, 0); lock (m_writer) m_writer.TrySend(ref msg, SendReceiveConstants.InfiniteTimeout, false); msg.Close(); }
/// <summary> /// Enqueue an item to the queue, will block if the queue is full. /// </summary> /// <param name="value"></param> public void Enqueue(T value) { m_queue.Enqueue(value); Msg msg = new Msg(); msg.InitGC(s_empty, 0); lock (m_writer) { m_writer.TrySend(ref msg, SendReceiveConstants.InfiniteTimeout, false); } msg.Close(); }
/// <summary> /// Transmit the given Msg over this actor's own socket. /// </summary> /// <param name="msg">the <c>Msg</c> to transmit</param> /// <param name="timeout">The maximum length of time to try and send a message. If <see cref="TimeSpan.Zero"/>, no /// wait occurs.</param> /// <param name="more">Indicate if another frame is expected after this frame</param> /// <returns><c>true</c> if a message was sent, otherwise <c>false</c>.</returns> /// <exception cref="TerminatingException">The socket has been stopped.</exception> /// <exception cref="FaultException"><paramref name="msg"/> is not initialised.</exception> public bool TrySend(ref Msg msg, TimeSpan timeout, bool more) { return(m_self.TrySend(ref msg, timeout, more)); }
public bool TrySend(ref Msg msg, TimeSpan timeout, bool more) { return(m_messagesPipe.TrySend(ref msg, timeout, more)); }