akitaext

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 3 Imported by: 4

Documentation

Overview

Package akitaext provides simple and convenient extensions for the Akita framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedSender

type BufferedSender interface {
	// CanSend checks if the buffer has enough space to hold "count" msguests.
	CanSend(count int) bool

	// Send enqueues a message into the buffer and the message will be sent out
	// later with the Tick function.
	Send(msg sim.Msg)

	// Clear removes all the msguests to send
	Clear()

	// Tick tries to send one msguest out. If successful, Tick returns true.
	Tick(now sim.VTimeInSec) bool
}

BufferedSender can delegate the sending process.

The most common usage of BufferedSender is to be used as the send stage of an Akita Component. It is common that multiple sub-component in a component need to send messages out from a port. Another common pattern is that a large number of messages are generated in one cycle and the messages are sent out one per cycle. In both cases, the msguest generate can push the packet into a BufferedSender and the call the BufferedSender's Tick function to actually send the msguests out.

func NewBufferedSender

func NewBufferedSender(port sim.Port, buffer buffering.Buffer) BufferedSender

NewBufferedSender creates a new BufferedSender with certain buffer capacity and send to a certain port.

Jump to

Keyboard shortcuts

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