consumer

package
v0.6.1-preview Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2016 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventAdapter

type EventAdapter interface {
	GetInterestedEvents() ([]*ehpb.Interest, error)
	Recv(msg *ehpb.Event) (bool, error)
	Disconnected(err error)
}

EventAdapter is the interface by which a openchain event client registers interested events and receives messages from the openchain event Server

type EventsClient

type EventsClient struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

EventsClient holds the stream and adapter for consumer to work with

func NewEventsClient

func NewEventsClient(peerAddress string, regTimeout time.Duration, adapter EventAdapter) (*EventsClient, error)

NewEventsClient Returns a new grpc.ClientConn to the configured local PEER.

func (*EventsClient) Recv

func (ec *EventsClient) Recv() (*ehpb.Event, error)

Recv recieves next event - use when client has not called Start

func (*EventsClient) RegisterAsync

func (ec *EventsClient) RegisterAsync(ies []*ehpb.Interest) error

RegisterAsync - registers interest in a event and doesn't wait for a response

func (*EventsClient) Start

func (ec *EventsClient) Start() error

Start establishes connection with Event hub and registers interested events with it

func (*EventsClient) Stop

func (ec *EventsClient) Stop() error

Stop terminates connection with event hub

func (*EventsClient) UnregisterAsync

func (ec *EventsClient) UnregisterAsync(ies []*ehpb.Interest) error

UnregisterAsync - Unregisters interest in a event and doesn't wait for a response

Jump to

Keyboard shortcuts

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