Documentation ¶
Index ¶
- func BuildTwixt(ctx model.SimContext, events []model.EventSource, main TwixtFunc)
- func DataBufferBytes(ctx model.SimContext, capacity int) (model.DataSourceBytes, model.DataSinkBytes)
- func DataPumpBytes(ctx model.SimContext, source model.DataSourceBytes, sink model.DataSinkBytes)
- func DataPumpDirect(ctx model.SimContext, source model.DataSourceBytes, sink func([]byte))
- func MakeMeteredSink(ctx model.SimContext, sink model.DataSinkBytes, bytesAllowed int, ...) model.DataSinkBytes
- func TeeDataSinks(ctx model.SimContext, sinks ...model.DataSinkBytes) model.DataSinkBytes
- type CSVByteRecorder
- type EventDispatcher
- type NullEventSource
- type Record
- type SimController
- func (sc *SimController) Advance(advanceTo model.VirtualTime) (nextTimer model.VirtualTime)
- func (sc *SimController) Later(name string, callback func()) (cancel func())
- func (sc *SimController) Now() model.VirtualTime
- func (sc *SimController) Rand() *rand.Rand
- func (sc *SimController) SetTimer(expireAt model.VirtualTime, name string, callback func()) (cancel func())
- type TwixtFunc
- type TwixtIO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTwixt ¶
func BuildTwixt(ctx model.SimContext, events []model.EventSource, main TwixtFunc)
BuildTwixt runs a function in an imperative side thread, returning to the simulation on each Yield().
func DataBufferBytes ¶
func DataBufferBytes(ctx model.SimContext, capacity int) (model.DataSourceBytes, model.DataSinkBytes)
func DataPumpBytes ¶
func DataPumpBytes(ctx model.SimContext, source model.DataSourceBytes, sink model.DataSinkBytes)
func DataPumpDirect ¶
func DataPumpDirect(ctx model.SimContext, source model.DataSourceBytes, sink func([]byte))
func MakeMeteredSink ¶
func MakeMeteredSink(ctx model.SimContext, sink model.DataSinkBytes, bytesAllowed int, perInterval time.Duration) model.DataSinkBytes
func TeeDataSinks ¶
func TeeDataSinks(ctx model.SimContext, sinks ...model.DataSinkBytes) model.DataSinkBytes
Types ¶
type CSVByteRecorder ¶
type CSVByteRecorder struct {
// contains filtered or unexported fields
}
func MakeCSVRecorder ¶
func MakeCSVRecorder(sim model.SimContext, path string) *CSVByteRecorder
func MakeNullCSVRecorder ¶
func MakeNullCSVRecorder() *CSVByteRecorder
func (*CSVByteRecorder) IsRecording ¶
func (r *CSVByteRecorder) IsRecording() bool
func (*CSVByteRecorder) Record ¶
func (r *CSVByteRecorder) Record(channel string, dataBytes []byte)
type EventDispatcher ¶
type EventDispatcher struct {
// contains filtered or unexported fields
}
func MakeEventDispatcher ¶
func MakeEventDispatcher(ctx model.SimContext, name string) *EventDispatcher
func (*EventDispatcher) Dispatch ¶
func (ed *EventDispatcher) Dispatch()
func (*EventDispatcher) DispatchLater ¶
func (ed *EventDispatcher) DispatchLater()
func (*EventDispatcher) Subscribe ¶
func (ed *EventDispatcher) Subscribe(callback func()) (cancel func())
type NullEventSource ¶
type NullEventSource struct{}
func (NullEventSource) Subscribe ¶
func (ns NullEventSource) Subscribe(callback func()) (cancel func())
type Record ¶
type Record struct { Timestamp model.VirtualTime Channel string Bytes []byte }
func DecodeRecording ¶
type SimController ¶
type SimController struct {
// contains filtered or unexported fields
}
func MakeSimControllerRandomized ¶
func MakeSimControllerRandomized(startTime model.VirtualTime) *SimController
func MakeSimControllerSeeded ¶
func MakeSimControllerSeeded(seed int64, startTime model.VirtualTime) *SimController
func (*SimController) Advance ¶
func (sc *SimController) Advance(advanceTo model.VirtualTime) (nextTimer model.VirtualTime)
func (*SimController) Later ¶
func (sc *SimController) Later(name string, callback func()) (cancel func())
func (*SimController) Now ¶
func (sc *SimController) Now() model.VirtualTime
func (*SimController) Rand ¶
func (sc *SimController) Rand() *rand.Rand
func (*SimController) SetTimer ¶
func (sc *SimController) SetTimer(expireAt model.VirtualTime, name string, callback func()) (cancel func())
type TwixtIO ¶
type TwixtIO struct {
// contains filtered or unexported fields
}
func (*TwixtIO) YieldUntil ¶
func (ti *TwixtIO) YieldUntil(time model.VirtualTime)
func (*TwixtIO) YieldWait ¶
func (ti *TwixtIO) YieldWait(events ...model.EventSource)
Click to show internal directories.
Click to hide internal directories.