/// <summary> /// Gets or creates a named channel from a marker setup /// </summary> /// <returns>The named channel.</returns> /// <param name="marker">The channel marker instance that describes the channel.</param> /// <typeparam name="T">The channel type.</typeparam> public static IChannel <T> Get <T>(ChannelMarkerWrapper <T> marker) { return(ChannelManager.GetChannel <T>(marker)); }
/// <summary> /// Gets a read channel from a marker interface. /// </summary> /// <returns>The requested channel.</returns> /// <param name="channel">The marker interface, or a real channel instance.</param> /// <typeparam name="T">The channel type.</typeparam> public static IReadChannelEnd <T> Get <T>(IReadChannel <T> channel) { return(ChannelManager.GetChannel <T>(channel)); }
/// <summary> /// Gets or creates a named channel. /// </summary> /// <returns>The named channel.</returns> /// <param name="attr">The attribute describing the channel.</param> /// <param name="scope">The scope to create a named channel in, defaults to null which means the current scope</param> /// <typeparam name="T">The channel type.</typeparam> public static IChannel <T> Get <T>(ChannelNameAttribute attr, ChannelScope scope = null) { return(ChannelManager.GetChannel <T>(attr, scope)); }
/// <summary> /// Gets or creates a named channel. /// </summary> /// <returns>The named channel.</returns> /// <param name="name">The name of the channel to find.</param> /// <param name="buffersize">The number of buffers in the channel.</param> /// <param name="scope">The scope to create a named channel in, defaults to null which means the current scope</param> /// <param name="maxPendingReaders">The maximum number of pending readers. A negative value indicates infinite</param> /// <param name="maxPendingWriters">The maximum number of pending writers. A negative value indicates infinite</param> /// <param name="pendingReadersOverflowStrategy">The strategy for dealing with overflow for read requests</param> /// <param name="pendingWritersOverflowStrategy">The strategy for dealing with overflow for write requests</param> /// <param name="broadcast"><c>True</c> will create the channel as a broadcast channel, the default <c>false</c> will create a normal channel</param> /// <param name="initialBroadcastBarrier">The number of readers required on the channel before sending the first broadcast, can only be used with broadcast channels</param> /// <param name="broadcastMinimum">The minimum number of readers required on the channel, before a broadcast can be performed, can only be used with broadcast channels</param> /// <typeparam name="T">The channel type.</typeparam> public static IChannel <T> Get <T>(string name, int buffersize = 0, ChannelScope scope = null, int maxPendingReaders = -1, int maxPendingWriters = -1, QueueOverflowStrategy pendingReadersOverflowStrategy = QueueOverflowStrategy.Reject, QueueOverflowStrategy pendingWritersOverflowStrategy = QueueOverflowStrategy.Reject, bool broadcast = false, int initialBroadcastBarrier = -1, int broadcastMinimum = -1) { return(ChannelManager.GetChannel <T>(name, buffersize, scope, maxPendingReaders, maxPendingWriters, pendingReadersOverflowStrategy, pendingWritersOverflowStrategy, broadcast, initialBroadcastBarrier, broadcastMinimum)); }
/// <summary> /// Gets or creates the channel in the current scope /// </summary> /// <returns>The channel instance.</returns> public IWriteChannelEnd <T> GetForWrite() { return(ChannelManager.GetChannel <T>(this).AsWriteOnly()); }
/// <summary> /// Gets or creates the channel in the current scope /// </summary> /// <returns>The channel instance.</returns> public IReadChannelEnd <T> GetForRead() { return(ChannelManager.GetChannel <T>(this).AsReadOnly()); }
/// <summary> /// Gets or creates the channel in the current scope /// </summary> /// <returns>The channel instance.</returns> public IChannel <T> Get() { return(ChannelManager.GetChannel <T>(this)); }