ClockModule

PackageAxial.PlatformService
Helpers for the clock service.

Summary

NameSignatureSynopsis
Operations
serviceClock.service Reads the service from the environment.
nowClock.now Reads the current UTC timestamp from an explicit clock service.
utcDateTimeClock.utcDateTime Reads the current UTC date/time from an explicit clock service.
unixTimeSecondsClock.unixTimeSeconds Reads the current Unix timestamp in seconds from an explicit clock service.
unixTimeMillisecondsClock.unixTimeMilliseconds Reads the current Unix timestamp in milliseconds from an explicit clock service.
liveClock.live Creates a live clock backed by .
fromValueClock.fromValue utcNowCreates a deterministic clock that always returns the supplied instant.
layerClock.layer Builds the live clock as a layer.

Operations

kind:member

service

Clock.service
Member
Reads the service from the environment.

Returns

Flow<'env, 'error, IClock>
kind:member

now

Clock.now
Member
Reads the current UTC timestamp from an explicit clock service.

Returns

Flow<'env, 'error, DateTimeOffset>
kind:member

utcDateTime

Clock.utcDateTime
Member
Reads the current UTC date/time from an explicit clock service.

Returns

Flow<'env, 'error, DateTime>
kind:member

unixTimeSeconds

Clock.unixTimeSeconds
Member
Reads the current Unix timestamp in seconds from an explicit clock service.

Returns

Flow<'env, 'error, int64>
kind:member

unixTimeMilliseconds

Clock.unixTimeMilliseconds
Member
Reads the current Unix timestamp in milliseconds from an explicit clock service.

Returns

Flow<'env, 'error, int64>
kind:member

live

Clock.live
Member
Creates a live clock backed by UtcNow.

Returns

IClock
kind:member

fromValue

Clock.fromValue utcNow
Member
Creates a deterministic clock that always returns the supplied instant.

Parameters

NameTypeDescription
utcNowDateTimeOffset

Returns

IClock
kind:member

layer

Clock.layer
Member
Builds the live clock as a layer.

Returns

Layer<unit, Never, IClock>