dragon.infrastructure.connection.Pipe

Pipe(duplex=True, *, channels=None, options=None)

Connection pair generator implemented over dragon.channels

The channels parameter can be None, indicating that this is an anonymous Pipe requiring a new channel to be constructed and eventually destroyed by the receiver.

It can also be a Channel object or descriptor in which case the two Connections returned will communicate through the channel, with one being in read mode and the other in write mode.

Finally, if it is a tuple, it is expected to have two elements which are both channels or channel descriptors and each of which can send and receive.

If the channels parameter is None, then the duplex parameter governs whether the connections are full duplex and whether two new channels get created or only one.

If not duplex, the first one is the reader and the second the writer

The options object carries lifecycle and creation options for the Pipe call and also policy settings for the Connection objects that result, as well as policy on how the Connections objects should interact with the pool when sending data.

Parameters:
  • channels – None or a Channel object or a 2-element tuple of distinct Channel objects

  • duplex – default True, whether to produce

  • options – a PipeOptions object

Returns:

a pair of Connection objects