Skip to content

Consider moving System.IO.Pipelines into the shared framework #28760

Closed
@ahsonkhan

Description

@ahsonkhan

Motivation:
The recent in-box JSON serializer APIs (see https://github.com/dotnet/corefx/issues/34372 / https://github.com/dotnet/apireviews/tree/master/2019/System.Text.Json-Serialization) expect to take PipeReader/PipeWriter. This results in System.Text.Json depending on System.IO.Pipelines. However, the Pipelines package is not part of the shared framework and hence cannot be referenced by S.T.Json.

See discussion here:
dotnet/apireviews#91 (comment)

Can we move parts of System.IO.Pipelines (or all of it) in-box?

If we consider Pipeline APIs "siblings" to streams, then they could be pushed down low enough within the stack for S.T.Json to take a dependency on it (but maybe not low enough to be pushed to corelib). Is that an appropriate view of pipelines? What are the risks/constraints with moving System.IO.Pipelines inbox?

Possible alternatives to resolve the motivation differently:

  1. The JSON serializer instead accepts some other abstraction that is implemented within System.Memory (an assembly it already depends on).
    • For example, on the writer/serializer side, an extension of the IBufferWriter interface, IAsyncBufferWriter which PipeWriter would implement (TBD for the reader/deserializer side).
  2. We invert the dependency where Pipelines depends on S.T.Json and PipeReader/Writer themselves provide serialize methods.
  3. We only move parts of S.IO.Pipelines in-box (i.e. only what's required - PipeReader/PipeWriter) as part of a new assembly. Does that result in freezing the OOB package?
  4. The JSON serializer doesn't provide direct PipeReader/PipeWriter support at all (less than ideal).

cc @davidfowl, @steveharter, @pakrym, @joshfree, @terrajobst, @jkotas, @stephentoub, @bartonjs, @ericstj, @KrzysztofCwalina

Metadata

Metadata

Assignees

Labels

area-System.IO.Pipelinesin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions