Commit Graph

6 Commits

Author SHA1 Message Date
Waldemar Quevedo
1c03e2bdce 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>
2020-12-09 16:28:03 -08:00
Derek Collison
948f5f80a1 Add in StreamInfo
Signed-off-by: Derek Collison <derek@nats.io>
2020-12-09 06:29:07 -08:00
Derek Collison
8424c59b41 Remove redundant check
Signed-off-by: Derek Collison <derek@nats.io>
2020-12-08 13:13:17 -08:00
Derek Collison
4dd05a834f Trying to ack a non JS msg would panic and hang
Signed-off-by: Derek Collison <derek@nats.io>
2020-12-08 13:06:23 -08:00
Derek Collison
090c71e95c Assign jsSub during low level subscription
Signed-off-by: Derek Collison <derek@nats.io>
2020-12-03 16:09:52 -08:00
Derek Collison
60de70431f JetStream API updates
Signed-off-by: Derek Collison <derek@nats.io>
2020-11-30 06:46:23 -08:00