/// <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> GetChannel <T>(IReadChannel <T> channel) { var rt = channel as ReadMarker <T>; if (rt == null) { return(channel.AsReadOnly()); } var scope = ChannelScope.Current; if (rt.Attribute.TargetScope == ChannelNameScope.Parent) { scope = scope.ParentScope; } else if (rt.Attribute.TargetScope == ChannelNameScope.Global) { scope = ChannelScope.Root; } return(GetChannel <T>(rt.Attribute, scope).AsReadOnly()); }
/// <summary> /// Initializes a new instance of the <see cref="CoCoL.Network.LatencyHidingReader<T>"/> class. /// </summary> /// <param name="parent">The channel where requests are made.</param> /// <param name="buffersize">The size of the buffer.</param> public LatencyHidingReader(IReadChannel <T> parent, int buffersize) : this(parent.AsReadOnly(), buffersize) { }