Skip to content

Repository files navigation

ci Dependabot Updates

Tickle

In-process, token-based pub/sub notifications with blocking waits.

Features

  • Subscribe to one or more string tokens
  • Tickle subscribers from any goroutine
  • Wait, WaitTimeout, and WaitContext on subscriptions
  • Safe disposal and unsubscribe
  • Subscribe(nil, ...) uses context.Background()
  • Buffered notifications win over dispose for wait calls

Installation

go get github.com/fgrzl/tickle

Quick example

sm := tickle.NewTickler()
sub := sm.Subscribe(context.Background(), "token1")

go func() {
    if sub.Wait() {
        fmt.Println("Received notification for token1")
    }
}()

time.Sleep(time.Second)
sm.Tickle("token1")

Documentation

Full guides: docs/

Running tests

go test ./...

Contributing

See CONTRIBUTING.md.

License

See repository license file.

About

In-process token-based pub/sub notifications with blocking waits for Go

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages