pool

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: CC0-1.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_LOCKS = 50

Variables

This section is empty.

Functions

This section is empty.

Types

type IncomingEvent

type IncomingEvent struct {
	*event.T
	Relay *relay.Relay
}

type SimplePool

type SimplePool struct {
	Relays  map[string]*relay.Relay
	Context context.T
	// contains filtered or unexported fields
}

func NewSimplePool

func NewSimplePool(c context.T) *SimplePool

func (*SimplePool) EnsureRelay

func (p *SimplePool) EnsureRelay(url string) (*relay.Relay, error)

func (*SimplePool) QuerySingle

func (p *SimplePool) QuerySingle(c context.T, urls []string, f *filter.T) *IncomingEvent

QuerySingle returns the first event returned by the first relay, cancels everything else.

func (*SimplePool) SubMany

func (p *SimplePool) SubMany(c context.T, urls []string, filters filters.T, unique bool) chan IncomingEvent

SubMany opens a subscription with the given filters to multiple relays the subscriptions only end when the context is canceled

func (*SimplePool) SubManyEose

func (p *SimplePool) SubManyEose(c context.T, urls []string, filters filters.T) chan IncomingEvent

SubManyEose is like SubMany, but it stops subscriptions and closes the channel when gets a EOSE

func (*SimplePool) SubManyEoseNonUnique

func (p *SimplePool) SubManyEoseNonUnique(c context.T, urls []string, filters filters.T) chan IncomingEvent

SubManyEoseNonUnique is like SubManyEose, but returns duplicate events if they come from different relays

func (*SimplePool) SubManyNonUnique

func (p *SimplePool) SubManyNonUnique(c context.T, urls []string, filters filters.T, unique bool) chan IncomingEvent

SubManyNonUnique is like SubMany, but returns duplicate events if they come from different relays

Jump to

Keyboard shortcuts

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