cc

package
v0.0.0-...-094bef0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventListener

type EventListener interface {
	// Register registers for a chaincode event
	Register(eventID string) error
	// BlockWait Block and wait for a chaincode event matching the previously registered eventID
	// Return cc event URL if event is received before timing out
	BlockWait(timeoutSeconds int, numMessages int) string
	// Close closes the listener and releases any assoicated resources
	Close()
}

EventListener is a chaincode event handler

type EventListenerImpl

type EventListenerImpl struct {
	ChannelID   string
	ChaincodeID string

	// an optional extra delay to apply before unblocking
	// upon receipt of event notification
	// a small time gap before returning notification so that
	// data will be available at more peers already by the time notitfication is received
	NotificationDelayMilliseconds int
	// contains filtered or unexported fields
}

EventListenerImpl is the default implementation of CCEventHandler

func (*EventListenerImpl) BlockWait

func (t *EventListenerImpl) BlockWait(timeoutSeconds int, numMessages int) (ccEventURL string)

BlockWait Blocks and wait for a chaincode event

func (*EventListenerImpl) Close

func (t *EventListenerImpl) Close()

Close closes the listener and releases any assoicated resources

func (*EventListenerImpl) Register

func (t *EventListenerImpl) Register(eventID string) error

Register registers for a chaincode event

Jump to

Keyboard shortcuts

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