Commit Graph

24 Commits

Author SHA1 Message Date
Waldemar Quevedo
f6886af9ec Make most of JS API types private
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2021-01-15 09:14:10 -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
585eab747f Support for no responders err on requests
Signed-off-by: Derek Collison <derek@nats.io>
2020-06-17 18:15:45 -07:00
R.I.Pienaar
c4ab892f58 add support for Requests using a Msg
Signed-off-by: R.I.Pienaar <rip@devco.net>
2020-06-03 12:05:06 +02:00
Derek Collison
d5ed91cb92 Simplify request, allow for mux subject to change
Signed-off-by: Derek Collison <derek@nats.io>
2019-10-08 14:56:32 -07:00
Ivan Kozlovic
3aedf875c5 Made a function that returns appropriate error on NextMsg failure
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-12 11:21:54 -06:00
Ivan Kozlovic
f3bebb626c [FIXED] Wrong error returned in NextMsg and NextMsgWithContext
If the application is in NextMsg() (or NextMsgWithContext()) and
the subscription is unsubscribed from a different go routine, the
NextMsg() call would return that the connection is closed, instead
of the subscription.

Resolves #404

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-07-12 09:53:00 -06:00
Derek Collison
df59787a1a Changed approach to always set type in low level subscribe
Signed-off-by: Derek Collison <derek@nats.io>
2019-03-14 13:13:48 -07:00
Derek Collison
24fe9ab48a Added FlushWithContext(), fixes #431
Signed-off-by: Derek Collison <derek@nats.io>
2019-02-21 14:20:13 -08:00
Derek Collison
9b7fc5fe4b Improve NextMsg() performance when msg available
Signed-off-by: Derek Collison <derek@nats.io>
2019-02-21 11:53:04 -08:00
Derek Collison
7d901ef636 Make new resp init function
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-04 07:13:42 -08:00
Derek Collison
139a6ac5e0 Faster and smaller reply suffix
Signed-off-by: Derek Collison <derek@nats.io>
2018-11-03 12:44:10 -07:00
Waldemar Quevedo
ccf165c2b9 Remove select and just check if context canceled
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-08-26 08:51:41 -07:00
Waldemar Quevedo
dc5dcc7970 Check if context canceled before waiting for Msg
Context can be used to cancel blocking waiting for a message, and in
the case that the context has already been canceled it is expected for
it to return right away since the context no longer valid.

Previous behavior was not deterministic since it was possible for a
client to still receive a messages even though the context was already
canceled.  In order to fix this, now we check first whether the
context has been canceled previous to waiting for the message to
prevent successfully making requests with invalid contexts.

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-08-25 19:55:44 -07:00
Derek Collison
2f0e8883ae CNCF, move to Apache 2 2018-03-17 13:36:48 -07:00
Tyler Treat
301a5b11ef Reduce locking around respSub 2017-06-06 10:54:39 -05:00
Tyler Treat
fc8a243776 Cleanup channel map on RequestWithContext timeout 2017-06-06 10:54:25 -05:00
Tyler Treat
c83b1128a8 Address CR feedback and missed RequestWithContext 2017-06-06 10:26:42 -05:00
Derek Collison
74eb51c143 New style response handler for RequestWithContext 2017-05-26 09:06:07 -07:00
Waldemar Quevedo
ebdfa4bc58 Add ErrInvalidContext check for when context is nil 2017-05-11 12:22:55 -07:00
Waldemar Quevedo
855d5bf98b Remove calling panic in client on nil Context 2017-05-11 09:57:49 -07:00
Waldemar Quevedo
183e43650e Add more tests to context cancellation 2017-05-11 09:57:49 -07:00
Waldemar Quevedo
580b6381e2 Separate validation checks from NextMsg into function
Add processNextMsgDelivered and reuse in NextMsg
2017-05-11 09:57:49 -07:00
Waldemar Quevedo
02343ff279 Add RequestWithContext API using context.Context
Add context aware APIs based on original ones

Rename prefix from context tests

Add context integration to encoded requests
2017-05-11 09:57:49 -07:00