data

package
v1.7.3-0...-caeaf44 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunUpdateTaskProcessor

func RunUpdateTaskProcessor(dataStore *DataStore)

func StartPlayerctlListener

func StartPlayerctlListener(dataStore *DataStore)

StartPlayerctlListener starts a background goroutine that listens for MPRIS changes via playerctl and triggers the media module update on change.

Types

type DataStore

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

func NewDataStore

func NewDataStore() (*DataStore, error)

func (*DataStore) GetAllModuleData

func (d *DataStore) GetAllModuleData() map[types.ModuleName]any

func (*DataStore) GetModule

func (d *DataStore) GetModule(name types.ModuleName) (types.Module, error)

func (*DataStore) GetRegisteredModules

func (d *DataStore) GetRegisteredModules() []types.Updater

func (*DataStore) Register

func (d *DataStore) Register(u types.Updater)

func (*DataStore) SetModuleData

func (d *DataStore) SetModuleData(name types.ModuleName, data any) error

func (*DataStore) TriggerModuleUpdate

func (d *DataStore) TriggerModuleUpdate(name types.ModuleName) error

TriggerModuleUpdate triggers an update for a specific module and broadcasts the update

type UpdateTaskProcessor

type UpdateTaskProcessor struct {
	// Data store to update
	DataStore *DataStore
	// contains filtered or unexported fields
}

UpdateTaskProcessor handles async task processing with rate limiting

func NewUpdateTaskProcessor

func NewUpdateTaskProcessor(dataStore *DataStore, tasksPerSecond float64, burstLimit int) (*UpdateTaskProcessor, error)

func (*UpdateTaskProcessor) AddTask

func (tp *UpdateTaskProcessor) AddTask(updater types.Updater)

AddTask queues a new task

func (*UpdateTaskProcessor) Start

func (tp *UpdateTaskProcessor) Start(workerCount int)

Start begins processing tasks

func (*UpdateTaskProcessor) Stop

func (tp *UpdateTaskProcessor) Stop()

Stop gracefully shuts down the processor

Directories

Path Synopsis
cpu

Jump to

Keyboard shortcuts

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