manager

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages subscriptions

func NewManager

func NewManager() *Manager

func (*Manager) HasSubscription

func (m *Manager) HasSubscription(operationID string) bool

HasSubscription returns true if the subscription exists

func (*Manager) Subscribe

func (m *Manager) Subscribe(sub *Subscription) error

Subscribe performs a subscribe operation

func (*Manager) Unsubscribe

func (m *Manager) Unsubscribe(operationID string)

Unsubscribe removes a single operation

func (*Manager) UnsubscribeAll

func (m *Manager) UnsubscribeAll()

Unsubscribe all unsubscribes and removes all operations for a specific connection id

type Subscription

type Subscription struct {
	Channel      chan *graphql.Result
	ConnectionID string
	OperationID  string
	Context      context.Context
	CancelFunc   context.CancelFunc
}

Subscription interface between ws and graphql execution

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL