package seqobsv

import "go.cryptoscope.co/margaret/internal/seqobsv"

Package seqobsv wants to supply an observable value sepcialized for sequence numbers in append-only logs. It should be fine for access from multiple goroutines.

These values only go up by one. For margaret they start with 0.

Index

Types

type Observable

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

func New

func New(start uint64) *Observable

New creates a new Observable

func (*Observable) Inc

func (seq *Observable) Inc() uint64

func (*Observable) Seq

func (seq *Observable) Seq() int64

func (*Observable) Value

func (seq *Observable) Value() uint64

Value returns the current value

func (*Observable) WaitFor

func (seq *Observable) WaitFor(n uint64) <-chan struct{}

Source Files

seqobsv.go

Version
v0.4.3 (latest)
Published
Feb 17, 2022
Platform
linux/amd64
Imports
2 packages
Last checked
14 hours ago

Tools for package owners.