manager

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 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) SubscriptionCount added in v0.2.0

func (m *Manager) SubscriptionCount(connectionIDs ...string) int

SubscriptionCount counts all or specific connection id subscriptions can be used for diagnostics

func (*Manager) Unsubscribe

func (m *Manager) Unsubscribe(operationID string) *Subscription

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 {
	IsSub         bool
	Channel       chan *graphql.Result
	ConnectionID  string
	OperationID   string
	OperationName 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