Help us shape the future of Go! Take the 2026 Go Developer Survey

hub

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT-0 Imports: 1 Imported by: 0

Documentation

Overview

Package hub fans out in-process mailbox change signals to IMAP sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hub

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

Hub is a concurrency-safe set of mailbox watchers. A notification is a coalescing signal, not a queue: watchers re-read the mailbox when woken.

func New

func New() *Hub

New returns an empty hub.

func (*Hub) Notify

func (h *Hub) Notify(mailboxID int64)

Notify wakes every watcher of mailboxID.

func (*Hub) Subscribe

func (h *Hub) Subscribe(mailboxID int64) (<-chan struct{}, func())

Subscribe returns a wake channel and a function that removes the subscription. The channel is buffered with one element so publishers never block.

Jump to

Keyboard shortcuts

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