signals

package module
v0.0.0-...-8088181 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2016 License: MIT Imports: 2 Imported by: 1

README

signals

Simple signals implementation for golang

Documentation

Overview

Signals is simple implementation of signals. Signals are meant to be created as module variables where multiple receivers can be connected.

receiver is interface for signal receiver that will be called.

signals is implementation of signal calling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Receiver

type Receiver interface {
	Dispatch(context.Context)
}

Receiver is interface for signal handling

type ReceiverFunc

type ReceiverFunc func(context.Context)

func (ReceiverFunc) Dispatch

func (r ReceiverFunc) Dispatch(c context.Context)

type Signal

type Signal interface {
	// Dispatch calls all receivers with given context
	Dispatch(context context.Context, wait bool)

	// Connect connects receiver
	Connect(Receiver, ...string) Signal
}

func New

func New() Signal

New returns new signal

Jump to

Keyboard shortcuts

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