depth

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 6 Imported by: 2

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)

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