netutil

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrList

type ErrList = swarmutil.ErrList

type SendQueue

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

SendQueue queues messages, and sends them in the background.

func NewSendQueue

func NewSendQueue(depth int, send TellFunc) SendQueue

func (*SendQueue) Close

func (sq *SendQueue) Close() error

func (*SendQueue) Tell

func (sq *SendQueue) Tell(ctx context.Context, dst inet256.Addr, m p2p.IOVec) error

type ServiceGroup

type ServiceGroup struct {
	Background context.Context
	// contains filtered or unexported fields
}

func (*ServiceGroup) Go

func (sg *ServiceGroup) Go(fn func(context.Context) error)

Go runs fn in another go routine. When the ServiceGroup is stopped the context passed to fn will be cancelled. If fn ever returns an error other than ctx.Err(), it will be logged. The service will be restarted, unless the group has been stopped.

func (*ServiceGroup) Stop

func (sg *ServiceGroup) Stop() error

type TellFunc

type TellFunc = func(ctx context.Context, dst inet256.Addr, m p2p.IOVec) error

type TellHub

type TellHub = swarmutil.TellHub[inet256.Addr]

func NewTellHub

func NewTellHub() *TellHub

type WorkerPool

type WorkerPool struct {
	Fn func(ctx context.Context)
	// contains filtered or unexported fields
}

func (*WorkerPool) SetCount

func (wp *WorkerPool) SetCount(count int)

func (*WorkerPool) Stop

func (wp *WorkerPool) Stop()

Jump to

Keyboard shortcuts

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