Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/oak_graphql/graphql-subscriptions/pubsub-async-iterator.ts>PubSubAsyncIterator

A simple graphql middleware for oak deno framework.
Latest
class PubSubAsyncIterator
implements AsyncIterator<T>
import { PubSubAsyncIterator } from "https://deno.land/x/oak_graphql@0.6.4/graphql-subscriptions/pubsub-async-iterator.ts";

A class for digesting PubSubEngine events via the new AsyncIterator interface. This implementation is a generic version of the AsyncIterator, so any PubSubEngine may be used.

Constructors

new
PubSubAsyncIterator(pubsub: PubSubEngine, eventNames: string | string[])

Properties

private
allSubscribed: Promise<number[]> | null
private
eventsArray: string[]
private
pubsub: PubSubEngine
private
pullQueue: ((value: IteratorResult<T>) => void)[]
private
pushQueue: T[]
private
running: boolean

Methods

private
emptyQueue()
private
pullValue(): Promise<IteratorResult<T>>
private
pushValue(event: T)
private
subscribeAll()
private
unsubscribeAll(subscriptionIds: number[])
next(): Promise<IteratorResult<T>>
return(): Promise<IteratorResult<T>>
throw(error: any)