handleloop

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: ISC Imports: 1 Imported by: 0

Documentation

Overview

Package handleloop provides clean abstractions to handle listening to channels and passing them onto event handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loop

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

Loop provides a reusable event looper abstraction. It is thread-safe to use concurrently.

func NewLoop

func NewLoop(dst *handler.Handler) *Loop

func (*Loop) Start

func (l *Loop) Start(src <-chan interface{})

Start starts a new event loop. It will try to stop existing loops before.

func (*Loop) Stop

func (l *Loop) Stop()

Stop tries to stop the Loop. If the Loop is not running, then it does nothing; thus, it can be called multiple times.

Jump to

Keyboard shortcuts

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