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

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/glycerine/go-sliding-window

Package swp implements the same Sliding Window Protocol that TCP uses for flow-control and reliable, ordered delivery. The Nats event bus (https://nats.io/) is a software model of a hardware multicast switch. Nats provides multicast, but no guarantees of delivery and no flow-control. This works fine as long as your downstream read/subscribe capacity is larger than your publishing rate. If your nats publisher evers produces faster than your subscriber can keep up, you may overrun your buffers and drop messages. If your sender is local and replaying a disk file of traffic over nats, you are guanateed to exhaust even the largest of the internal nats client buffers. In addition you may wish guaranteed order of delivery (even with dropped messages), which swp provides. Hence swp was built to provide flow-control and reliable, ordered delivery on top of the nats event bus. It reproduces the TCP sliding window and flow-control mechanism in a Session between two nats clients. It provides flow control between exactly two nats endpoints; in many cases this is sufficient to allow all subscribers to keep up. If you have a wide variation in consumer performance, establish the rate-controlling swp Session between your producer and your slowest consumer. There is also a Session.RegisterAsap() API that can be used to obtain possibly-out-of-order and possibly-duplicated but as-soon-as-possible delivery (similar to that which nats give you natively), while retaining the flow-control required to avoid client-buffer overrun. This can be used in tandem with the main always-ordered-and-lossless API if so desired.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/glycerine/go-sliding-window
License: MIT
Latest release: about 8 years ago
First release: about 8 years ago
Namespace: github.com/glycerine
Stars: 56 on GitHub
Forks: 4 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 27 days ago

    Loading...
    Readme
    Loading...