Documentation ¶
Index ¶
- type HubSource
- type LIBGetter
- type Option
- type SubscriptionHub
- func (h *SubscriptionHub) HeadBlock() bstream.BlockRef
- func (h *SubscriptionHub) HeadBlockID() string
- func (h *SubscriptionHub) Launch()
- func (h *SubscriptionHub) NewHubSourceFromBlockNum(blockNum uint64, handler bstream.Handler) (*HubSource, error)
- func (h *SubscriptionHub) NewSource(handler bstream.Handler, burst int) bstream.Source
- func (h *SubscriptionHub) NewSourceFromBlockNum(blockNum uint64, handler bstream.Handler) bstream.Source
- func (h *SubscriptionHub) NewSourceFromBlockNumWithOpts(blockNum uint64, handler bstream.Handler, opts ...bstream.JoiningSourceOption) bstream.Source
- func (h *SubscriptionHub) NewSourceFromBlockRef(ref bstream.BlockRef, handler bstream.Handler) bstream.Source
- func (h *SubscriptionHub) WaitReady()deprecated
- func (h *SubscriptionHub) WaitUntilRealTime()
- type TailLockFunc
- type TestLIBGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HubSource ¶
HubSource has the following guarantees: * if a ProcessBlock() returns an error to this source, ProcessBlock will not be called again by this source. * if a ProcessBlock() calls source.Shutdown(), the source will not call ProcessBlock again. (this was an issue with BufferedHandler solution) WARNING: because of that second guarantee, allowing ProcessBlock to call its own source's shutdown function, you should never assume that there is no ongoing or incoming ProcessBlock() when calling source.Shutdown() from another thread. Don't do anything dangerous like closing a channel awaiting a Write from that source! Let the channel die from garbage collecting, wrap your reads and writes with select() on context.Terminating() or source.Terminating() and so on.
type Option ¶
type Option func(*SubscriptionHub)
func WithRealtimeTolerance ¶
func WithSourceChannelSize ¶
type SubscriptionHub ¶
type SubscriptionHub struct {
// contains filtered or unexported fields
}
SubscriptionHub hooks to a live data source
func NewSubscriptionHub ¶
func NewSubscriptionHub(startBlock uint64, buffer *bstream.Buffer, tailLockFunc TailLockFunc, fileSourceFactory bstream.SourceFromNumFactory, liveSourceFactory bstream.SourceFromNumFactory, opts ...Option) (*SubscriptionHub, error)
func (*SubscriptionHub) HeadBlock ¶
func (h *SubscriptionHub) HeadBlock() bstream.BlockRef
func (*SubscriptionHub) HeadBlockID ¶
func (h *SubscriptionHub) HeadBlockID() string
func (*SubscriptionHub) Launch ¶
func (h *SubscriptionHub) Launch()
func (*SubscriptionHub) NewHubSourceFromBlockNum ¶
func (*SubscriptionHub) NewSourceFromBlockNum ¶
func (*SubscriptionHub) NewSourceFromBlockNumWithOpts ¶
func (h *SubscriptionHub) NewSourceFromBlockNumWithOpts(blockNum uint64, handler bstream.Handler, opts ...bstream.JoiningSourceOption) bstream.Source
func (*SubscriptionHub) NewSourceFromBlockRef ¶
func (*SubscriptionHub) WaitReady
deprecated
func (h *SubscriptionHub) WaitReady()
Deprecated: Use `WaitUntilRealTime` instead.
func (*SubscriptionHub) WaitUntilRealTime ¶
func (h *SubscriptionHub) WaitUntilRealTime()
type TailLockFunc ¶
type TestLIBGetter ¶
type TestLIBGetter struct {
LIB uint64
}
func (*TestLIBGetter) GetRealtimeLIB ¶
func (g *TestLIBGetter) GetRealtimeLIB() (uint64, error)