arrow-kt / arrow-fx

Λrrow Fx is part of Λrrow, a functional companion to Kotlin's Standard Library
http://arrow-kt.io
Other
64 stars 15 forks source link

Improve Schedule for 1.0.0 #389

Closed nomisRev closed 3 years ago

nomisRev commented 3 years ago

Issue

Status

READY

Description

Since arrow.fx.coroutines.repeat conflicts with kotlin.repeat which IDEA always auto-suggests and prefers over arrow.fx.coroutines.repeat since kotlin is a special case, we need an alternative API for repeat (and retry) so this is now defined as a method on Schedule itself. Since retry's Schedule has as input type of Throwable it's defined as a extension function on Schedule instead of a top-level function that takes a Schedule.

Since Arrow Fx Coroutines Duration is deprecated in favor of Kotlin Time's Duration we need to provide alternative APIs to deprecate towards. This PR adds these alternative methods, and the required deprecation messages.

Related PRs

nomisRev commented 3 years ago

Thanks for the great review @aballano!

nomisRev commented 3 years ago

@aballano applied review suggestions. The only thing I can think of to improve the nanos situation is to make the API use milliseconds instead which I guess is more common in public APIs. kotlin.time.* should just go stable 😫