Пример #1
0
 /// <summary>
 ///     Create a new Pipe object with the given parent, and inbound and outbound YPipes.
 /// </summary>
 /// <remarks>
 ///     Constructor is private as pipe can only be created using <see cref="PipePair" /> method.
 /// </remarks>
 private Pipe(
     [NotNull] ZObject parent, [NotNull] YPipe <Msg> inboundPipe, [NotNull] YPipe <Msg> outboundPipe,
     int inHighWatermark, int outHighWatermark, int predefinedLowWatermark, bool delay)
     : base(parent)
 {
     this.m_parent                  = parent;
     this.m_inboundPipe             = inboundPipe;
     this.m_outboundPipe            = outboundPipe;
     this.m_inActive                = true;
     this.m_outActive               = true;
     this.m_highWatermark           = outHighWatermark;
     this.m_lowWatermark            = Pipe.ComputeLowWatermark(inHighWatermark, predefinedLowWatermark);
     this.m_numberOfMessagesRead    = 0;
     this.m_numberOfMessagesWritten = 0;
     this.m_peersMsgsRead           = 0;
     this.m_peer  = null;
     this.m_sink  = null;
     this.m_state = State.Active;
     this.m_delay = delay;
 }
Пример #2
0
 /// <summary>
 ///     Create a new ZObject that has the same context and thread-id as the given parent-ZObject.
 /// </summary>
 /// <param name="parent">another ZObject that provides the context and thread-id for this one</param>
 protected ZObject([NotNull] ZObject parent)
     : this(parent.m_ctx, parent.m_threadId)
 {
 }
Пример #3
0
 /// <summary>
 ///     Create a new Command object for the given destination, type, and optional argument.
 /// </summary>
 /// <param name="destination">a ZObject that denotes the destination for this command</param>
 /// <param name="type">the CommandType of the new command</param>
 /// <param name="arg">an Object to comprise the argument for the command (optional)</param>
 public Command([CanBeNull] ZObject destination, CommandType type, [CanBeNull] object arg = null) : this()
 {
     this.Destination = destination;
     this.CommandType = type;
     this.Arg         = arg;
 }