taskmanager

package
v0.0.0-...-9bee2a0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixManager     = "MANAGER_"
	PrefixAssociation = "ASSOCIATION_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	ID              string
	AssociationID   string
	FirestoreClient *firestore.Client
	Mu              sync.Mutex
	// contains filtered or unexported fields
}

func NewManager

func NewManager(firestoreClient *firestore.Client) *Manager

func (*Manager) PublishToAssociation

func (m *Manager) PublishToAssociation(
	ctx context.Context,
	targetID string,
	taskType string,
	payload []byte,
) error

func (*Manager) PublishToManager

func (m *Manager) PublishToManager(
	ctx context.Context,
	targetID string,
	taskType string,
	payload []byte,
) error

func (*Manager) SetSubscribeHandler

func (m *Manager) SetSubscribeHandler(handler SubscribeHandler)

func (*Manager) StartManager

func (m *Manager) StartManager(
	id string,
	associationID string,
	errorCh chan error,
)

type SubscribeHandler

type SubscribeHandler func(string, []byte) error

Jump to

Keyboard shortcuts

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