ClockModule

PackageAxial.PlatformService
Helpers for the clock service.

Summary

NameSignatureSynopsis
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.

service

Clock.service
Member
Reads the service from the environment.

Returns

Flow<'env, 'error, IClock>

now

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

Returns

Flow<'env, 'error, DateTimeOffset>

utcDateTime

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

Returns

Flow<'env, 'error, DateTime>

unixTimeSeconds

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

Returns

Flow<'env, 'error, int64>

unixTimeMilliseconds

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

Returns

Flow<'env, 'error, int64>

live

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

Returns

IClock

fromValue

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

Parameters

NameTypeDescription
utcNowDateTimeOffset

Returns

IClock

layer

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

Returns

Layer<unit, Never, IClock>