- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 442
 
Open
Labels
enhancementv4Related to version < 5.0.0Related to version < 5.0.0v5Related to version 5.0.0+Related to version 5.0.0+
Description
I was surprised that the runtime-dependent timeout implementation does not utilize the HasTime<RT> trait for the internal timeout task.
Current version
// signature (see https://github.com/louthy/language-ext/blob/main/LanguageExt.Core/Effects/Aff/Prelude/Aff.Prelude.cs#L228)
public static Aff<RT, A> timeout<RT, A>(TimeSpan timeoutDelay, Aff<RT, A> ma) where RT : struct, HasCancel<RT>
// timeout task implementation (see https://github.com/louthy/language-ext/blob/main/LanguageExt.Core/Effects/Aff/Aff.cs#L174)
var delay = Task.Delay(timeoutDelay, delayTokSrc.Token);What I expected
// signature
public static Aff<RT, A> timeout<RT, A>(TimeSpan timeoutDelay, Aff<RT, A> ma) where RT : struct, HasCancel<RT>, HasTime<RT>
// timeout task implementation
// something like...
var delay = ?...? env.TimeEff.Map(timeIO => timeIO.SleepFor(timeoutDelay, delayTokSrc.Token)) ?...?Is my expectation unusual?
(If not, any change is probably a breaking change, so it comes down to extending the method documentation and maybe provide a timeout2 function)
Metadata
Metadata
Assignees
Labels
enhancementv4Related to version < 5.0.0Related to version < 5.0.0v5Related to version 5.0.0+Related to version 5.0.0+