package events

import "github.com/docker/docker/daemon/events"

Index

Types

type Events

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

Events is pubsub channel for *jsonmessage.JSONMessage

func New

func New() *Events

New returns new *Events instance

func (*Events) Evict

func (e *Events) Evict(l chan interface{})

Evict evicts listener from pubsub

func (*Events) Log

func (e *Events) Log(action, id, from string)

Log broadcasts event to listeners. Each listener has 100 millisecond for receiving event or it will be skipped.

func (*Events) Subscribe

func (e *Events) Subscribe() ([]*jsonmessage.JSONMessage, chan interface{})

Subscribe adds new listener to events, returns slice of 64 stored last events channel in which you can expect new events in form of interface{}, so you need type assertion.

func (*Events) SubscribersCount

func (e *Events) SubscribersCount() int

SubscribersCount returns number of event listeners

Source Files

events.go

Version
v1.7.0-rc5
Published
Jun 16, 2015
Platform
js/wasm
Imports
4 packages
Last checked
1 hour ago

Tools for package owners.