example

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FireDoneTimeout is how long fireDone will wait for both sending and receiving.
	FireDoneTimeout = 3 * time.Second
)

Variables

This section is empty.

Functions

func WithClients

func WithClients(
	transportType testutils.TransportType,
	keyValueYarpcServer examplepb.KeyValueYarpcServer,
	sinkYarpcServer examplepb.SinkYarpcServer,
	f func(*Clients) error,
) error

WithClients calls f on the Clients.

Types

type Clients

type Clients struct {
	KeyValueYarpcClient examplepb.KeyValueYarpcClient
	SinkYarpcClient     examplepb.SinkYarpcClient
	KeyValueGRPCClient  examplepb.KeyValueClient
	SinkGRPCClient      examplepb.SinkClient
}

Clients holds all clients.

type KeyValueYarpcServer

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

KeyValueYarpcServer implements examplepb.KeyValueYarpcServer.

func NewKeyValueYarpcServer

func NewKeyValueYarpcServer() *KeyValueYarpcServer

NewKeyValueYarpcServer returns a new KeyValueYarpcServer.

func (*KeyValueYarpcServer) GetValue

GetValue implements GetValue.

func (*KeyValueYarpcServer) SetValue

SetValue implements SetValue.

type SinkYarpcServer

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

SinkYarpcServer implements examplepb.SinkYarpcServer.

func NewSinkYarpcServer

func NewSinkYarpcServer(withFireDone bool) *SinkYarpcServer

NewSinkYarpcServer returns a new SinkYarpcServer.

func (*SinkYarpcServer) Fire

func (s *SinkYarpcServer) Fire(ctx context.Context, request *examplepb.FireRequest) error

Fire implements Fire.

func (*SinkYarpcServer) Values

func (s *SinkYarpcServer) Values() []string

Values returns a copy of the values that have been fired.

func (*SinkYarpcServer) WaitFireDone

func (s *SinkYarpcServer) WaitFireDone() error

WaitFireDone blocks until a fire is done, if withFireDone is set.

If will timeout after FireDoneTimeout and return error.

Jump to

Keyboard shortcuts

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