event

package
v0.0.0-...-f342e06 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package event provides some primitives that are used for message passing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resp

type Resp chan error

Resp is a channel to be used for boolean responses. A nil represents an ACK, and a non-nil represents a NACK (false). This also lets us use custom errors.

func NewResp

func NewResp() Resp

NewResp is just a helper to return the right type of response channel.

func (Resp) ACK

func (resp Resp) ACK()

ACK sends a true value to resp.

func (Resp) ACKNACK

func (resp Resp) ACKNACK(err error)

ACKNACK sends a custom ACK or NACK. The ACK value is always nil, the NACK can be any non-nil error value.

func (Resp) ACKWait

func (resp Resp) ACKWait()

ACKWait waits for a +ive Ack from a Resp channel.

func (Resp) NACK

func (resp Resp) NACK()

NACK sends a false value to resp.

func (Resp) Wait

func (resp Resp) Wait() error

Wait waits for any response from a Resp channel and returns it.

Jump to

Keyboard shortcuts

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