ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Progress.Internal

Description

The window Ecluse.Core.Registry.Progress keeps for each transfer, and its pure transitions. Importing this module opts out of the public surface's stability promises. It exists so a spec can hold the transitions to a reference.

Synopsis

Documentation

data Window Source #

The nanoseconds waited and the bytes moved in the current window, each constructor's last two fields. Waiting first holds the monotonic time its open wait on the upstream began.

Constructors

Waiting !Word64 !Word64 !Int 
Idle !Word64 !Int 

freshWindow :: Window Source #

No wait open, nothing waited, and nothing moved: a transfer's start, and the window after the floor's bytes.

beginAt :: Word64 -> Window -> Window Source #

Open a wait at a monotonic time in nanoseconds.

endAt :: ProgressFloor -> Word64 -> Int -> Window -> Window Source #

Close the open wait with the bytes it moved. Reaching the floor's bytes starts a new window.

waitedBy :: Word64 -> Window -> Word64 Source #

The nanoseconds waited by a monotonic time. The sweeper can read its clock just before the transfer stamps a later wait, so the open wait's gap floors at zero.