Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTimestampObject ¶
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.
type TimestampSignalHelper ¶
type TimestampSignalHelper interface{}
TimestampSignalHelper provided to Timestamp a companion object
type Timestamper ¶
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.