Skip to content

Commit

Permalink
Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyicker committed Jul 4, 2024
1 parent 71a83ed commit 584aff9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ Version numbers can be found under [Releases](https://github.com/tidal-music/net
## Usage

Create your `SNTPClient` via its constructor. Its API allows you to toggle synchronization (starts
off) and to retrieve the time based on the latest successful synchronization, if any.
off) and to retrieve the time based on the latest successful synchronization.

The property that retrieves the aforementioned time is nullable as it will return `null` if no
The nullable property `epochTime` retrieves the aforementioned time will return `null` if no
synchronization has occurred successfully during the lifetime of the process and no backup file has
been specified for the `SNTPClient` instance or said file contains no valid prior synchronization
data.

As an alternative, the `blockingEpochTime` method can be used to suspend the caller until a valid
synchronization or backup restoration occurs to avoid a nullable return type.

## networktime-singletons

This is a tiny utility on top of the base artifact that extends the `SNTPClient` API by adding a new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class SNTPClient(
val epochTime by delegate::epochTime

/**
* The calculated epoch time, blocking until it has been calculated at least once.
* The calculated epoch time. Suspends the caller until said time has been calculated at least
* once.
*/
@ObjCName(name = "blockingEpochTimeMs")
suspend fun blockingEpochTime() = delegate.blockingEpochTime()
Expand Down

0 comments on commit 584aff9

Please sign in to comment.