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.
Click to show internal directories.
Click to hide internal directories.