failsafe-lib / failsafe

Fault tolerance and resilience patterns for the JVM
https://failsafe.dev
Apache License 2.0
4.2k stars 297 forks source link

Typo: Execution Cancellation: Extra ) #333

Closed numeralnathan closed 2 years ago

numeralnathan commented 2 years ago

Please correct the typo on this https://failsafe.dev/execution-cancellation/ for this line.

scheduler.schedule(() -> call.cancel(false), 10, TimeUnit.SECONDS);`

There is an extra ) after false. Perhaps, the code is correct and I struggled with Lisp.

Tembrel commented 2 years ago

Looks ok to me:

scheduler.schedule(() -> call.cancel(false), 10, TimeUnit.SECONDS);

schedule takes 3 arguments, callable, delay, and unit.

cancel takes one boolean argument.

Reformatting makes this more obvious:

scheduler.schedule(
    () -> call.cancel(false)
    10,
    TimeUnit.SECONDS
);
numeralnathan commented 2 years ago

Thank you. That ) tripped me up.