client

package
v0.0.0-...-57a6056 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewWithPubsub

func NewWithPubsub(ps *pubsub.PubSub, networkName string) (*Client, error)

NewWtihPubsub creates a gossip randomness client.

func (*Client) Close

func (c *Client) Close() error

Close stops Client, cancels PubSub subscription and closes the topic.

func (*Client) Sub

func (c *Client) Sub(ch chan drand.PublicRandResponse) UnsubFunc

Sub subscribes to notfications about new randomness. Client instnace owns the channel after it is passed to Sub function, thus the channel should not be closed by library user

It is recommended to use a buffered channel. If the channel is full, notification about randomness will be dropped.

Notification channels will be closed when the client is Closed

type UnsubFunc

type UnsubFunc func()

Jump to

Keyboard shortcuts

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