io.janstenpickle.hotswapref

Type members

Classlikes

trait ConditionalHotswapRefConstructor[F[_], I, R] extends HotswapRefConstructor[F, I, R]

Adds functionality to HotswapRefConstructor to check whether input I has changed and only if it has, swap the current value of R with a new cats.effect.kernel.Resource.

Adds functionality to HotswapRefConstructor to check whether input I has changed and only if it has, swap the current value of R with a new cats.effect.kernel.Resource.

Companion
object
trait HotswapRef[F[_], R]

A concurrent data structure that wraps a cats.effect.std.Hotswap providing access to R using a cats.effect.kernel.Ref, that is set on resource acquisition, while providing asynchronous hotswap functionality via calls to swap.

A concurrent data structure that wraps a cats.effect.std.Hotswap providing access to R using a cats.effect.kernel.Ref, that is set on resource acquisition, while providing asynchronous hotswap functionality via calls to swap.

In short, calls to swap do not block the usage of R via calls to access.

Repeated concurrent calls to swap are ordered by a semaphore to ensure that R doesn't churn unexpectedly. As with calls to swap on cats.effect.std.Hotswap, swap will block until the previous cats.effect.kernel.Resource is finalized. Additionally open references to R are counted when it is accessed via access, any R with open references will block at finalization until all references are released, and therefore subsequent calls to swap will block.

Companion
object
object HotswapRef
Companion
class
trait HotswapRefConstructor[F[_], I, R] extends HotswapRef[F, (I, R)]

Use some I to construct R via a provided function, within a HotswapRef.

Use some I to construct R via a provided function, within a HotswapRef.

Calls to swapWith update the value of R within HotswapRef with provided with some I.

Companion
object
trait Lock[F[_]]
Companion
object
object Lock
Companion
class