Documentation ¶
Index ¶
- type Buffer
- func (b *Buffer) AddUpdate(o types.SliceOrderBook, firstUpdateID int64, finalArgs ...int64) error
- func (b *Buffer) EmitPush(update Update)
- func (b *Buffer) EmitReady(snapshot types.SliceOrderBook, updates []Update)
- func (b *Buffer) EmitReset()
- func (b *Buffer) OnPush(cb func(update Update))
- func (b *Buffer) OnReady(cb func(snapshot types.SliceOrderBook, updates []Update))
- func (b *Buffer) OnReset(cb func())
- func (b *Buffer) Reset()
- func (b *Buffer) SetBufferingPeriod(d time.Duration)
- type SnapshotFetcher
- type Update
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 ¶
AddUpdate adds the update to the buffer or push the update to the subscriber
func (*Buffer) EmitReady ¶
func (b *Buffer) EmitReady(snapshot types.SliceOrderBook, updates []Update)
func (*Buffer) OnReady ¶
func (b *Buffer) OnReady(cb func(snapshot types.SliceOrderBook, updates []Update))
func (*Buffer) SetBufferingPeriod ¶
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
}
Click to show internal directories.
Click to hide internal directories.