Std.Concurrent.Coordinate
23 public declarations
- acquire
&Std.Concurrent.Coordinate.Semaphore -> Result[(), Std.Concurrent.Coordinate.CoordinateError]Take a permit, waiting until one is free.
- add
&Std.Concurrent.Coordinate.WaitGroup -> Int -> Result[(), Std.Concurrent.Coordinate.CoordinateError]Add outstanding work. Answers
Finishedonce the group has been idle. - available
&Std.Concurrent.Coordinate.Semaphore -> Result[Int, Std.Concurrent.Coordinate.CoordinateError]How many permits are free right now.
- CoordinateError
Why a coordination step did not do what it was asked.
- countDown
&Std.Concurrent.Coordinate.Latch -> Result[(), Std.Concurrent.Coordinate.CoordinateError]Count down once; the count-down reaching zero opens the latch. Counting
- done
&Std.Concurrent.Coordinate.WaitGroup -> Result[(), Std.Concurrent.Coordinate.CoordinateError]Mark one piece of outstanding work done. The last one makes the group
- explain
&Std.Concurrent.Coordinate.CoordinateError -> StrA sentence saying what went wrong.
- isOpen
&Std.Concurrent.Coordinate.Latch -> BoolWhether the latch has opened.
- latch
Int -> Std.Concurrent.Coordinate.LatchA latch opening after
countcount-downs; a count below one opens at once. - Latch
A gate that opens once its count reaches zero, waking every waiter.
- once
Std.Concurrent.Coordinate.Once[T]A value not yet computed.
- Once
A value computed at most once, by whichever caller asks first.
- peek
&Std.Concurrent.Coordinate.Once[T] -> Option[T]The value if it has been computed.
- release
&Std.Concurrent.Coordinate.Semaphore -> Result[(), Std.Concurrent.Coordinate.CoordinateError]Return a permit. Answers
Overreleasedwhen no permit is out. - resolve
&Std.Concurrent.Coordinate.Once[T] -> fn() -> T -> Result[T, Std.Concurrent.Coordinate.CoordinateError]The value, computing it with
initif no caller has yet.initruns on a - semaphore
Int -> Std.Concurrent.Coordinate.SemaphoreA semaphore holding
countpermits; a count below one is taken as one. - Semaphore
A count of permits. The free ones wait in
permits;outcounts those - waitGroup
Std.Concurrent.Coordinate.WaitGroupA wait group with nothing outstanding.
- WaitGroup
A count of outstanding work that can be waited on until it returns to
- waitGroupIdle
&Std.Concurrent.Coordinate.WaitGroup -> Result[(), Std.Concurrent.Coordinate.CoordinateError]Wait until nothing is outstanding. A group waited on with nothing added
- waitLatch
&Std.Concurrent.Coordinate.Latch -> Result[(), Std.Concurrent.Coordinate.CoordinateError]Wait until the latch opens.
- waitLatchWithin
&Std.Concurrent.Coordinate.Latch -> Int -> Result[Bool, Std.Concurrent.Coordinate.CoordinateError]Wait at most
millisfor the latch; answers whether it opened. - withPermit
&Std.Concurrent.Coordinate.Semaphore -> fn() -> T -> Result[T, Std.Concurrent.Coordinate.CoordinateError]Run an action holding a permit. The action runs on a thread of its own,
