Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate JetStream into smaller interfaces
This separates the JetStream interface into two smaller interfaces: A JetStream interface which is for producing and consuming messages and a JetStreamManager interface for creating streams/consumers. This also adds a new interface that is the compound of both called JetStreamContext and is the one that is being returned when calling `nc.JetStream()`. This change allows to opt-in to the behaviors provided by the JetStreamContext as needed, for example: ```go // Can be used to produce/consume messages, but not for creating streams var js nats.JetStream js, err = nc.JetStream() // Can be used for managing streams/consumers var jsm nats.JetStreamManager js, err = nc.JetStream() // Can still be used to both create streams and publish js, err := nc.JetStream() ``` Signed-off-by: Waldemar Quevedo <wally@synadia.com>
- Loading branch information
Showing
2 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters