Skip to content

Commit 7eb8986

Browse files
committed
lazyTimeout - add Task.defer to make it lazy
1 parent f126d73 commit 7eb8986

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/com/avsystem/commons/concurrent/TaskExtensions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object TaskExtensions extends TaskExtensions {
2121
* Similar to [[Task.timeoutWith]] but exception instance is created lazily (for performance)
2222
*/
2323
def lazyTimeout(after: FiniteDuration, msg: => String): Task[T] =
24-
task.timeoutTo(after, Task.raiseError(new TimeoutException(msg)))
24+
task.timeoutTo(after, Task.defer(Task.raiseError(new TimeoutException(msg))))
2525

2626
/**
2727
* Similar to [[Task.tapEval]], accepts simple consumer function as an argument

0 commit comments

Comments
 (0)