clock

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTimestampObject

func NewTimestampObject() bus.Actor

NewTimestampObject creates a timestamp object which can be registered to a bus.Server.

func TimestampObject

func TimestampObject(impl TimestampImplementor) bus.Actor

TimestampObject returns an object using TimestampImplementor

Types

type TimestampImplementor

type TimestampImplementor interface {
	// Activate is called before any other method.
	// It shall be used to initialize the interface.
	// activation provides runtime informations.
	// activation.Terminate() unregisters the object.
	// activation.Session can access other services.
	// helper enables signals and properties updates.
	// Properties must be initialized using helper,
	// during the Activate call.
	Activate(activation bus.Activation, helper TimestampSignalHelper) error
	OnTerminate()
	Nanoseconds() (int64, error)
}

TimestampImplementor interface of the service implementation

type TimestampProxy

type TimestampProxy interface {
	Nanoseconds() (int64, error)
	// Generic methods shared by all objectsProxy
	bus.ObjectProxy
	// WithContext can be used cancellation and timeout
	WithContext(ctx context.Context) TimestampProxy
}

TimestampProxy represents a proxy object to the service

func CreateTimestamp

func CreateTimestamp(session bus.Session, service bus.Service, impl TimestampImplementor) (TimestampProxy, error)

CreateTimestamp registers a new object to a service and returns a proxy to the newly created object

func MakeTimestamp

func MakeTimestamp(sess bus.Session, proxy bus.Proxy) TimestampProxy

MakeTimestamp returns a specialized proxy.

func Timestamp

func Timestamp(session bus.Session) (TimestampProxy, error)

Timestamp returns a proxy to a remote service

type TimestampSignalHelper

type TimestampSignalHelper interface{}

TimestampSignalHelper provided to Timestamp a companion object

type Timestamper

type Timestamper time.Time

Timestamper creates monotonic timestamps.

func SynchronizedTimestamper

func SynchronizedTimestamper(session bus.Session) (Timestamper, error)

SynchronizedTimestamper returns a locally generated timestamp source synchronized is the remote Timestamp service.

func (Timestamper) Nanoseconds

func (t Timestamper) Nanoseconds() (int64, error)

Nanoseconds returns the timestamp.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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