Can System.Threading.Channels internal types be made public?
I've created a custom channel implementation that draws heavily from the Bounded and Unbounded Channel implementations. I've copied some types from System.Threading.Channels for the implementation I'm working on to use such as AsyncOperations.cs and ChannelUtilities.cs. Is there any chance these could be exposed publicly so that I don't have to maintain them?
Thanks for the interest. We would not just publish these types as public. They're just implementation details, with no attention paid to the general use, shape, impact, etc. of the APIs. If there are specific APIs you believe should be added to the library publicly (regardless of whether they currently have implementations), please submit those as dedicated API proposal issues. As currently written we should not just make these types public. Thanks.
@stephentoub, thanks. The AsyncOperations is primarily what I am after. As you pointed out in https://devblogs.microsoft.com/dotnet/understanding-the-whys-whats-and-whens-of-valuetask/ implementation of IValueTaskSource are complex, hence my want to use something that is built and working. The article also points to the type ManualResetValueTaskSourceCore<TResult>. I haven't looked into working with this yet, but would it be possible for system.threading.channels to have an implementation of the interface and expose as something that is public and usable for implementations deriving from Channel
Please first look at ManualResetValueTaskSourceCore<TResult>; creating a class that implements the IValueTaskSource interface is trivial when using that type, with the interface method implementations just delegating to members of that struct, e.g.
https://github.com/dotnet/corefx/blob/637e109e7d085b8c01b5ba22521c021f8204ff12/src/Common/tests/System/Threading/Tasks/Sources/ManualResetValueTaskSource.cs#L7-L21
AsyncOperation<TResult> will eventually be gutted to just be based on MRVTSC. The AsyncOperation<TResult> internal surface area is very specific to the exact needs of the few types that are using it in Channels; it is not designed for general consumption.