store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package store is QuickFIX/Go's in-memory message store with a lock around it, so the sequence numbers can be read while the session runs.

The engine's own memory store is used as is; this only serializes access to it. A session goroutine owns the store and the lab reads NextSender / NextTarget from elsewhere to show them, which unlocked would be a data race. Nothing is written to disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

Factory creates one locked memory store per session and remembers it so its sequence numbers can be read by session ID.

func NewFactory

func NewFactory() *Factory

NewFactory returns an empty factory.

func (*Factory) Create

Create implements quickfix.MessageStoreFactory.

func (*Factory) Forget

func (f *Factory) Forget(id quickfix.SessionID)

Forget drops the factory's reference to a finished session's store.

func (*Factory) Len

func (f *Factory) Len() int

Len is how many stores the factory still references.

func (*Factory) Seq

func (f *Factory) Seq(id quickfix.SessionID) (nextOut, nextIn int, ok bool)

Seq returns the session's next outbound and next expected inbound sequence numbers, as the engine's store holds them.

type Locked

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

Locked is a MessageStore with every method under one mutex.

func (*Locked) Close

func (l *Locked) Close() error

func (*Locked) CreationTime

func (l *Locked) CreationTime() time.Time

func (*Locked) GetMessages

func (l *Locked) GetMessages(begin, end int) ([][]byte, error)

func (*Locked) IncrNextSenderMsgSeqNum

func (l *Locked) IncrNextSenderMsgSeqNum() error

func (*Locked) IncrNextTargetMsgSeqNum

func (l *Locked) IncrNextTargetMsgSeqNum() error

func (*Locked) IterateMessages

func (l *Locked) IterateMessages(begin, end int, cb func([]byte) error) error

IterateMessages copies the range under the lock and calls cb outside it, so a callback that sends (a resend does) cannot deadlock on this store.

func (*Locked) NextSenderMsgSeqNum

func (l *Locked) NextSenderMsgSeqNum() int

func (*Locked) NextTargetMsgSeqNum

func (l *Locked) NextTargetMsgSeqNum() int

func (*Locked) Refresh

func (l *Locked) Refresh() error

func (*Locked) Reset

func (l *Locked) Reset() error

func (*Locked) SaveMessage

func (l *Locked) SaveMessage(seq int, msg []byte) error

func (*Locked) SaveMessageAndIncrNextSenderMsgSeqNum

func (l *Locked) SaveMessageAndIncrNextSenderMsgSeqNum(seq int, msg []byte) error

func (*Locked) SetCreationTime

func (l *Locked) SetCreationTime(t time.Time)

func (*Locked) SetNextSenderMsgSeqNum

func (l *Locked) SetNextSenderMsgSeqNum(n int) error

func (*Locked) SetNextTargetMsgSeqNum

func (l *Locked) SetNextTargetMsgSeqNum(n int) error

Jump to

Keyboard shortcuts

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