Remove task collector from JDC and Translator. #1362
Shourya742
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
The task collector was added in this PR: #1001 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In both JDC and tproxy, we utilize a task collector ([JDC](
stratum/roles/jd-client/src/lib/mod.rs
Line 79 in a306512
stratum/roles/translator/src/lib/mod.rs
Line 61 in a306512
initial_jdc
in JDC andinternal_start
in tproxy. This mechanism ensures that, in the event of an abort scenario, these child tasks can be terminated, allowing the parent future to spawn a new set of futures for reconnection.Recently, we revised the reconnection logic for the parent future. Previously, it could become blocking during connection interruptions. To address this, we now spawn the parent future as a separate task, enabling the
select
blocks ([JDC](stratum/roles/translator/src/lib/mod.rs
Line 91 in a306512
stratum/roles/jd-client/src/lib/mod.rs
Line 117 in a306512
With this change, the core concept behind the task collector can be simplified. We can now leverage a root future handler that, upon termination, can terminate all its child tasks in a single operation.
Beta Was this translation helpful? Give feedback.
All reactions