types

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppServiceDeviceID is the AS dummy device ID
	AppServiceDeviceID = "AS_Device"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationServiceWorkerState

type ApplicationServiceWorkerState struct {
	AppService config.ApplicationService
	Cond       *sync.Cond
	// Events ready to be sent
	EventsReady bool
	// Backoff exponent (2^x secs). Max 6, aka 64s.
	Backoff int
}

ApplicationServiceWorkerState is a type that couples an application service, a lockable condition as well as some other state variables, allowing the roomserver to notify appservice workers when there are events ready to send externally to application services.

func (*ApplicationServiceWorkerState) FinishEventProcessing

func (a *ApplicationServiceWorkerState) FinishEventProcessing()

FinishEventProcessing marks all events of this worker as being sent to the application service.

func (*ApplicationServiceWorkerState) NotifyNewEvents

func (a *ApplicationServiceWorkerState) NotifyNewEvents()

NotifyNewEvents wakes up all waiting goroutines, notifying that events remain in the event queue for this application service worker.

func (*ApplicationServiceWorkerState) WaitForNewEvents

func (a *ApplicationServiceWorkerState) WaitForNewEvents()

WaitForNewEvents causes the calling goroutine to wait on the worker state's condition for a broadcast or similar wakeup, if there are no events ready.

Jump to

Keyboard shortcuts

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