tsm

package
v0.0.0-...-1d4abbb Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTransaction = 255

MaxTransaction is the default max number of transactions that can occur concurrently

Variables

This section is empty.

Functions

This section is empty.

Types

type TSM

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

TSM is the transaction state manager. It handles passing data to other processes and keeping track of what transactions are currently processed

func New

func New(size int) *TSM

New creates a new transaction manager

func (*TSM) ID

func (t *TSM) ID(ctx context.Context) (int, error)

ID returns the invoke id that was used to save the state of this connection.

func (*TSM) Put

func (t *TSM) Put(id int) error

Put allows the id to be reused in the transaction manager

func (*TSM) Receive

func (t *TSM) Receive(id int, timeout time.Duration) (interface{}, error)

Receive attempts to receive a byte array from the invoked id. If a time out period has passed then an error is returned

func (*TSM) Send

func (t *TSM) Send(id int, b interface{}) error

Send data to invoked id

Jump to

Keyboard shortcuts

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