subscriber

package
v0.0.0-...-270d295 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Implementation for cgo preamble functions

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedNew  = errors.New("failed to create new subscriber")
	ErrRcvTimeout = errors.New("timed out")
	ErrRcvBadType = errors.New("receive could not handle type")
)

Functions

This section is empty.

Types

type GenericSubscriber

type GenericSubscriber[T any] struct {
	ecaltypes.Subscriber

	Messages chan T

	Deserialize func(unsafe.Pointer, int) T
	// contains filtered or unexported fields
}

func NewGenericSubscriber

func NewGenericSubscriber[T any](
	topic string,
	datatype ecaltypes.DataType,
	deserializer func(unsafe.Pointer, int) T,
) (*GenericSubscriber[T], error)

func (*GenericSubscriber[T]) Delete

func (sub *GenericSubscriber[T]) Delete()

func (*GenericSubscriber[T]) Receive

func (sub *GenericSubscriber[T]) Receive(timeout time.Duration) (T, error)

Receive a new message from the eCAL receive callback.