An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 6.8% on proxy.golang.org
Top 6.1% forks on proxy.golang.org

proxy.golang.org : github.com/dmcgowan/streams

Package streams is an interface for using multiplexed transports protocols in a way that allows swapping between protocols without changing the higher level implementation. The `StreamProvider` interface is intended to abstract the underlying protocol in a way that is centered around creating and managing the individually multiplexed streams. Streams may either be created locally or remotely. In the case of remotely created streams, a listener must be used to accept new streams. The `Stream` interface allows sending and receiving bytes as easy as any io.ReadWriteCloser. In addition to reading and writing, the interface allows for retrieving the create headers and fully resetting the stream. The `Close` method is used to signal that no more writes will occur locally on the stream. This puts the stream in a half-closed state, still allowing for remote writes and local reads. Once the remote side calls `Close`, the stream will be fully closed, causing any future reads to return `io.EOF`. The `Reset` method is used to force the stream into a fully closed state. This should only be called in error cases which do not allow for any further action to occur on the stream. Forcing the stream into a fully close state may cause remote writes to fail, which should be handled by the remote. The `Listener` interface is used to retrieve remotely created streams for local use. The `Accept` method will return the new stream will require the application to manage the local lifecycle of that stream. If the retrieved stream is invalid, possibly due to a bad header configuration, the application should call `Reset` on the stream, indicating to the remote side this stream will not be used.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/dmcgowan/streams
License: MIT
Latest release: about 9 years ago
First release: about 9 years ago
Namespace: github.com/dmcgowan
Stars: 14 on GitHub
Forks: 2 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 1 day ago

    Loading...
    Readme
    Loading...