bussignal

package
v0.3.24 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 5 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 bussignal is what lys-shell's D-Bus signal readers share beyond dbusx's watches: the bus announcing that a name lost its owner, and the upkeep of a signal channel a reader holds itself because its signals come from paths or peers no watch can name ahead of time. Every channel owns the descriptors of the signals it is handed, so a reader that does not take them over discards each signal it has read and takes its channel off the connection with Remove.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discard

func Discard(sig *dbus.Signal)

Discard closes the descriptors sig carries, for the reader of a channel that has read it and takes none of them over. A signal without descriptors costs nothing.

func OnNameLost

func OnNameLost(lost func(name string, announced dbus.Sequence) error) dbusx.Route

OnNameLost routes the bus's announcement that a name lost its owner to lost, in a watch of dbusx.FromBus: a well-known name released, or the unique name of a peer that left the bus. lost also gets the announcement's sequence on the connection, which orders the loss against a reply the name's owner sent (dbus.Call.ResponseSequence): an answer sequenced before it came from an owner that has left since. WithArg0 narrows the route to one name.

func Remove

func Remove(conn *dbus.Conn, signals chan *dbus.Signal)

Remove takes signals off conn and discards the signals it was sent and nobody read.

func Ticks

func Ticks(ctx context.Context, conn *dbus.Conn, from dbusx.Sender, what string, routes func(tick func()) []dbusx.Route) (ticks <-chan struct{}, stop func(), err error)

Ticks is a watch as a feed of ticks: routes builds the watch's routes around tick, which a handler calls for a signal that changed what the caller reads. One tick is pending at most. The feed closes once the watch has ended, with ctx, with stop or with the connection; stop returns once the watch has taken its match rules off conn. A signal that does not decode is logged under what.

Types

This section is empty.

Directories

Path Synopsis
Package bussignaltest holds what the tests of lys-shell's signal readers share: a descriptor to send in a signal, and the proof that every copy of it the bus handed the process was closed again.
Package bussignaltest holds what the tests of lys-shell's signal readers share: a descriptor to send in a signal, and the proof that every copy of it the bus handed the process was closed again.

Jump to

Keyboard shortcuts

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