Skip to content

How can I broadcast the result of a mutation with a subscription in Actix? #1038

Answered by tyranron
Teajey asked this question in Q&A
Discussion options

You must be logged in to vote

@Teajey

Or is Juniper's support for subscriptions just too nascent to enable something like this yet?

Yes. It's far beyond Juniper responsibilities.

Or is there an event system in either Juniper or Actix that I should be leveraging?

Juniper definitely doesn't have something like that. While you may try to use Actix channels/actors for that purpose.

Perhaps you would put an event iterator stream (?) in the GraphQL context that the mutations push to and the subscription consumes?

Context is a thing to leave per-request only. You may still wire them via link to something global though.

In our codebases we solve this by having a "reactive state". Either in-memory (futures-signals, for e…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Teajey
Comment options

@tyranron
Comment options

@Teajey
Comment options

Answer selected by Teajey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants