Skip to main content

GraphQlTransactionSubscription

type GraphQlTransactionSubscription​

A live subscription.

Call `next` in a loop to receive updates. It returns `None` once `cancel` has been called. If the indexer requires a newer SDK, `next` raises that error and the subscription ends: later calls return `None`. The subscription never ends otherwise.

type GraphQlTransactionSubscription struct {
// contains filtered or unexported fields
}

func LiftFromExternalGraphQlTransactionSubscription​

func LiftFromExternalGraphQlTransactionSubscription(handle uint64) *GraphQlTransactionSubscription

func (*GraphQlTransactionSubscription) Cancel​

func (_self *GraphQlTransactionSubscription) Cancel()

Cancel the subscription, dropping the connection and unblocking a pending `next`.

Idempotent, and safe to call while `next` is pending — the pending call drops the connection on its way out.

Named `cancel` rather than `close` because a `close` method collides with the disposal method uniffi generates for objects in some languages.

func (*GraphQlTransactionSubscription) Destroy​

func (object *GraphQlTransactionSubscription) Destroy()

func (*GraphQlTransactionSubscription) IsCanceled​

func (_self *GraphQlTransactionSubscription) IsCanceled() bool

Whether the subscription has been canceled.

func (*GraphQlTransactionSubscription) Next​

func (_self *GraphQlTransactionSubscription) Next() (*GraphQlTransactionUpdate, error)

Wait for the next update.

Returns `None` once the subscription has been canceled. Concurrent calls are serialized; there is no ordering guarantee between them.

Raises for errors the subscription cannot recover from by itself, such as a rejected filter. The subscription stays usable afterwards, so a caller that considers the error transient can keep calling `next`. The exception is the error whose message starts with "the indexer requires a newer IOTA SDK": the subscription ends with it, and later calls return `None`.