Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Allow access to raw output stream #3

@neoeinstein

Description

@neoeinstein

Currently Representation only allows for supplying a byte array, which is then streamed out over the wire. This means that the byte array must be pre-constructed. This is not always convenient or efficient, especially for larger replies.

Proposal: Alter Representation by changing the type of the Data field from byte array to ResponseData. ResponseData would be defined as:

type ResponseData =
  | Bytes of byte array
  | DelayedStream of Stream -> Async<unit> // Job<unit> for Hopac

This will allow for streaming responses, which may mean less memory pressure in the long run. (I see an opportunity for Chiron to be able to stream its data to the wire in this way.)

This would be a breaking change, requiring the addition of the word Bytes to existing code that explicitly creates Representation records.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions