-
Notifications
You must be signed in to change notification settings - Fork 1
ipc
import "github.com/AarC10/GSW-V2/lib/ipc"- type Reader
- type ReaderMessage
-
type ShmHandler
- func CreateShmReader(identifier string, shmDir string) (*ShmHandler, error)
- func NewShmHandler(identifier string, telemetryPacketSize int, isWriter bool, shmDir string) (*ShmHandler, error)
- func (handler *ShmHandler) Cleanup()
- func (handler *ShmHandler) Read(ctx context.Context) (ReaderMessage, error)
- func (handler *ShmHandler) ReadRaw() ([]byte, error)
- func (handler *ShmHandler) Write(data []byte) error
- type ShmReaderMessage
- type Writer
Reader implements a blocking interface for reading from IPC. This is not thread safe.
type Reader interface {
Read(ctx context.Context) (ReaderMessage, error)
Cleanup()
}ReaderMessage represents data read from IPC.
type ReaderMessage interface {
Data() []byte
}ShmHandler is a shared memory handler for inter-process communication
type ShmHandler struct {
// contains filtered or unexported fields
}func CreateShmReader(identifier string, shmDir string) (*ShmHandler, error)CreateShmReader creates a shared memory reader for inter-process communication
func NewShmHandler(identifier string, telemetryPacketSize int, isWriter bool, shmDir string) (*ShmHandler, error)NewShmHandler creates a shared memory handler for inter-process communication
func (handler *ShmHandler) Cleanup()Cleanup cleans up the shared memory handler and removes the shared memory file
func (handler *ShmHandler) Read(ctx context.Context) (ReaderMessage, error)Read the current message in shared memory.
func (handler *ShmHandler) ReadRaw() ([]byte, error)ReadRaw returns a copy of the current packet in SHM.
func (handler *ShmHandler) Write(data []byte) errorWrite sends a message to shared memory
ShmReaderMessage is a message read by an ShmHandler
type ShmReaderMessage struct {
// contains filtered or unexported fields
}func (m *ShmReaderMessage) Data() []byteData returns the message data.
func (m *ShmReaderMessage) Futex() uint32ReceiveTimestamp returns the message futex value (an incrementing counter). This could be used to estimate message loss.
func (m *ShmReaderMessage) ReceiveTimestamp() uint64ReceiveTimestamp returns the unix timestamp when the message was received (nanoseconds since epoch).
Writer is an interface for sending data across processes
type Writer interface {
Write(data []byte) error
Cleanup()
}Generated by gomarkdoc