-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: add onOperationComplete & onOperationError callbacks #2
feat: add onOperationComplete & onOperationError callbacks #2
Conversation
@NeedleInAJayStack This should allow for unsubscribe handling |
@NeedleInAJayStack Let me know if you think this looks like a more complete system. I added in an |
var onOperationComplete: () -> Void = {} | ||
var onOperationError: () -> Void = {} |
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.
It would be convenient for both of these to provide the ID of the operation that has completed or errored.
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.
Good call, added.
@@ -64,6 +66,7 @@ public class Server<InitPayload: Equatable & Codable> { | |||
return | |||
} | |||
|
|||
// handle incoing message |
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.
Fix incoing
to incoming
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.
Oops fixed.
@@ -6,7 +6,7 @@ import GraphQLRxSwift | |||
import NIO | |||
import RxSwift | |||
|
|||
/// Server implements the server-side portion of the protocol, allowing a few callbacks for customization. | |||
/// Server implements the server-side portion of the protocol, allowing a few callbacks for customization. 0 or 1 subscriptions per connection and no more. |
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.
Why do we specify 0 or 1 subscription? I believe it can support any number of subscriptions, as long as they have different IDs.
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.
This was just an incorrect assumption by me that I forgot to remove. Removed now.
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.
Looks great! Thanks @GNMoseke!
Chore: Pull base changes
Adds an onComplete callback & registration function for configuring behavior when the server receives a
complete
message