loop

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package loop is the single-threaded event loop that owns compositor state.

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("loop: closed")

Functions

func Monotonic

func Monotonic() time.Duration

func NewManual

func NewManual(start time.Duration) (*Loop, *Manual, error)

Types

type Events

type Events uint32
const (
	Readable Events = unix.EPOLLIN
	Writable Events = unix.EPOLLOUT
	Hangup   Events = unix.EPOLLHUP | unix.EPOLLRDHUP
	Error    Events = unix.EPOLLERR
	Edge     Events = unix.EPOLLET
	OneShot  Events = unix.EPOLLONESHOT
)

type Loop

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

func New

func New() (*Loop, error)

func (*Loop) AddFD

func (l *Loop) AddFD(fd int, events Events, handler func(Events) error) (*Source, error)

func (*Loop) AddSignals

func (l *Loop) AddSignals(handler func(os.Signal) error, sigs ...os.Signal) (*Signals, error)

func (*Loop) AddTimer

func (l *Loop) AddTimer(handler func() error) (*Timer, error)

func (*Loop) BeforeIdle

func (l *Loop) BeforeIdle(f func() error)

func (*Loop) BeforeWait

func (l *Loop) BeforeWait(f func() error)

func (*Loop) Busy

func (l *Loop) Busy() time.Duration

func (*Loop) Close

func (l *Loop) Close() error

func (*Loop) Hand

func (l *Loop) Hand(what string, f func() error)

func (*Loop) Idle

func (l *Loop) Idle(f func() error)

func (*Loop) Now

func (l *Loop) Now() time.Duration

func (*Loop) Once

func (l *Loop) Once(fd int, handler func() error) error

func (*Loop) Post

func (l *Loop) Post(f func() error) error

func (*Loop) Run

func (l *Loop) Run() error

func (*Loop) Stop

func (l *Loop) Stop()

func (*Loop) Virtual

func (l *Loop) Virtual() bool

func (*Loop) Wakeups

func (l *Loop) Wakeups() int

type Manual

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

func (*Manual) Follow

func (m *Manual) Follow(source func() time.Duration)

func (*Manual) NextFrame

func (m *Manual) NextFrame() (time.Duration, bool)

func (*Manual) NextTimer

func (m *Manual) NextTimer() (time.Duration, bool)

func (*Manual) Now

func (m *Manual) Now() time.Duration

func (*Manual) Set

func (m *Manual) Set(now time.Duration)

func (*Manual) WaitAtMost

func (m *Manual) WaitAtMost(d time.Duration)

func (*Manual) WhenDry

func (m *Manual) WhenDry(f func())

type Serial

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

func (*Serial) Run

func (s *Serial) Run(job func())

func (*Serial) Wait

func (s *Serial) Wait()

type Signals

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

func (*Signals) Remove

func (s *Signals) Remove()

type Source

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

func (*Source) Modify

func (s *Source) Modify(events Events) error

func (*Source) Remove

func (s *Source) Remove() error

type Timer

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

func (*Timer) Arm

func (t *Timer) Arm(d time.Duration) error

func (*Timer) ArmFrame

func (t *Timer) ArmFrame(d time.Duration) error

func (*Timer) Disarm

func (t *Timer) Disarm() error

func (*Timer) Remove

func (t *Timer) Remove() error

Jump to

Keyboard shortcuts

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