portal

package module
Version: v0.0.0-...-f44339b Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2018 License: MIT Imports: 2 Imported by: 0

README

portal

Channels + messaging patterns = portals

Godoc Reference Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrChanClosed = errors.New("close of closed portal.Chan")

ErrChanClosed is thrown in a panic if a Chan is closed more than once

Functions

func OptAsync

func OptAsync(bufSize int) func(*portal)

OptAsync creates a buffered chan of the specified size

Types

type Chan

type Chan interface {
	Send() chan<- interface{}
	Recv() <-chan interface{}
	Close()
}

Chan is a two-way channel

type Endpoint

type Endpoint interface {
	Close()
	Done() <-chan struct{}
	Inbox() <-chan interface{}
	Outbox() chan<- interface{}
}

Endpoint represents the different IO channels that a Protocol must manage

type Portal

type Portal interface {
	Open() Chan
	Close()
}

Portal provides a thread-safe communication channel with messaging patterns.

func New

func New(p Protocol, opts ...option) Portal

New Portal

type Protocol

type Protocol interface {
	Close()
	AddEndpoint(Endpoint)
	RemoveEndpoint(Endpoint)
}

Protocol defines a messaging topology

Directories

Path Synopsis
protocol
bus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL