mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Pass the reference to RepeatedTask to its closure to allow a thread-safe cancelling. Motivation: With the current implementation, one has to create a reference and use a lock to thread-safely cancel the RepeatedTask. This makes the use more difficult and error-prone. Modifications: Added a RepeatedTask parameter to the scheduleRepeatedTask closure. Result: It is now possible to cancel the RepeatedTask from within the task closure.