-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return error from subscription callbacks #799
Merged
Merged
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
107a4e9
subscription: Allow errors in subscription callbacks
lexnv e05f5a8
subscription: Remove the need to own the error
lexnv 866595f
error: Build `ErrorObject` from `CallError` for improved ergonomics
lexnv 52a9c41
Update examples for the new subscription API
lexnv 6d25ec3
Add alias for subscription result
lexnv d5e0fc8
macros: Render server subscription method with `ResultSubscription`
lexnv fb6268d
Port `proc_macro` example to new API
lexnv 924c0ee
Rename `ResultSubscription` to `ReturnTypeSubscription` to avoid conf…
lexnv 60058eb
Port all tests to new subscription API
lexnv 5ee4ee1
Update documentation
lexnv 50525f5
Port benches
lexnv eca7ce6
Replace tabs with spaces & add documentation
lexnv ab3ab52
Add dummy error for subscriptions
lexnv efe48fe
Implement `From` for `SubscriptionError`
lexnv 2089161
Return `SubscriptionError` when parsing params
lexnv 710ee3c
Rename `SubscriptionError` to `SubscriptionEmptyError`
lexnv 95245d9
Change `accept` signature
lexnv 00a91f4
Port tests to new `accept` api
lexnv acb65d4
Implement `pipe_from_try_stream` and `pipe_from_stream` for `PendingS…
lexnv bf167f8
Modify examples to ilustrate new API
lexnv f8cd8b4
Fix docs tests
lexnv 70b9d8e
Rename previously `SubscriptionResult` -> `InnerSubscriptionResult`
lexnv 4efef2d
Rename `ReturnTypeSubscription` -> `SubscriptionResult`
lexnv c2c29a2
Remove documentation line
lexnv 368d803
Implement `PipeFromStreamResult`
lexnv 9a21c54
Add comment for empty error
lexnv 1065fd1
Update proc-macros/src/lib.rs
lexnv 2a0a89c
Update proc-macros/src/lib.rs
lexnv 9cb9e1a
Update proc-macros/src/lib.rs
lexnv 96dda16
Change `ReturnTypeSubscription` -> `SubscriptionResult`
lexnv bab6eaf
Add `ResultConsumed` for `PipeFromStreamResult`
lexnv ae59750
Update examples to use `PipeFromStreamResult`
lexnv 549e6ba
Replace ConsumedResult with Options
lexnv 61b1e0e
Merge remote-tracking branch 'origin/master' into 734_error_subscript…
lexnv e6ed17b
Log warning when subscription callback fails
lexnv f95403e
Change ubuntu test names
lexnv 8d8858c
server: Make `pipe` methods of `SubscriptionSink` private
lexnv d3c3ce9
server: Remove `pipe_from_stream` method of `SubscriptionSink`
lexnv 0b1c927
server: Update PipeFromStreamResult documentation
lexnv 8cf401c
Adjust tests to `SubscriptionSink::pipe_from_stream` private interface
lexnv 348f366
Add `accept-reject` API on `SubscriptionSink`
lexnv 15f18c0
Make `pipe_from_try_stream` public
lexnv 5d21441
Maybe accept the subscription
lexnv 277bbd7
Revert "server: Remove `pipe_from_stream` method of `SubscriptionSink`"
lexnv 64f45e9
Make `unsubscribe` channel optional on accepting the connection
lexnv 712112b
Pass `SubscriptionSink` to subscription callbacks
lexnv 1f66edf
Implement subscription sink state
lexnv 99ffeb7
Submit `InvalidParams` if sink was never accepted
lexnv 7657202
Handle rejected sinks
lexnv 24fcf3e
Remove `PendingSubscription`
lexnv f30d9d0
Fix doc tests
lexnv c968cac
macro: Make subscription sink mutable
lexnv 38f3a9f
Fix tests and examples
lexnv 53eeff9
macro: Return `sink.reject()` result
lexnv c7b2867
tests: Add test for `SubscriptionSinkState`
lexnv 9e8f649
Test internal subscription sink state
lexnv 18d8169
Fix `send_error` to not always return `false`
lexnv 1d983c7
Fix benches
lexnv 639e524
Remove `PipeFromStreamResult`
lexnv 45cfdf0
Use valid Json-RPC return code for test errors
lexnv abbea2c
Remove `SubscriptionSinkState`"
lexnv 8d3f7e5
Remodel state machine using `Option`s for `SubscriptionSink`s
lexnv f5952de
tests: Double accept / reject API for `SubscriptionSink`
lexnv 8b04cd1
Implement `SubscriptionAcceptRejectError` for error propagation
lexnv 61a03eb
Remove `maybe_accept` wrapper
lexnv 2a36c26
Update comments and documentation
lexnv 13de232
Update core/src/server/rpc_module.rs
lexnv 9df5b42
Update core/src/server/rpc_module.rs
lexnv 77ab7de
rpc_server: Add type alias for unsubscription calls
lexnv 0f255ad
rpc_server: Improve comment regarding dropped error
lexnv 997706a
style: Single line return errors
lexnv c4f0f49
Make comment more verbose
jsdw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a simple two-variant enum could help understand what the
bool
returned fromsend_error
specifically meansThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree I think it was designed like that to be easy convert to "success/or not" in the middleware but it's unrelated this PR.
Let's tackle it another PR.