depth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: AGPL-3.0 Imports: 7 Imported by: ? 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 Buffer

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

func NewBuffer

func NewBuffer(fetcher SnapshotFetcher) *Buffer

func (*Buffer) AddUpdate

func (b *Buffer) AddUpdate(o types.SliceOrderBook, firstUpdateID int64, finalArgs ...int64) error

AddUpdate adds the update to the buffer or push the update to the subscriber

func (*Buffer) EmitPush

func (b *Buffer) EmitPush(update Update)

func (*Buffer) EmitReady

func (b *Buffer) EmitReady(snapshot types.SliceOrderBook, updates []Update)

func (*Buffer) EmitReset

func (b *Buffer) EmitReset()

func (*Buffer) OnPush

func (b *Buffer) OnPush(cb func(update Update))

func (*Buffer) OnReady

func (b *Buffer) OnReady(cb func(snapshot types.SliceOrderBook, updates []Update))

func (*Buffer) OnReset

func (b *Buffer) OnReset(cb func())

func (*Buffer) Reset

func (b *Buffer) Reset()

func (*Buffer) SetBufferingPeriod

func (b *Buffer) SetBufferingPeriod(d time.Duration)

func (*Buffer) SetUpdateTimeout

func (b *Buffer) SetUpdateTimeout(d time.Duration)

type SnapshotFetcher

type SnapshotFetcher func() (snapshot types.SliceOrderBook, finalUpdateID int64, err error)

type Update

type Update struct {
	FirstUpdateID, FinalUpdateID int64

	// Object is the update object
	Object types.SliceOrderBook
}

Jump to

Keyboard shortcuts

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