File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,6 +201,8 @@ impl ModuleInstance for JsInstance {
201201 }
202202}
203203
204+ /// Spawns a thread that will terminate reducer execution
205+ /// when `budget` has been used up.
204206fn run_reducer_timeout ( isolate_handle : IsolateHandle , budget : ReducerBudget ) -> Arc < AtomicBool > {
205207 let execution_done_flag = Arc :: new ( AtomicBool :: new ( false ) ) ;
206208 let execution_done_flag2 = execution_done_flag. clone ( ) ;
@@ -224,12 +226,14 @@ fn run_reducer_timeout(isolate_handle: IsolateHandle, budget: ReducerBudget) ->
224226 execution_done_flag
225227}
226228
229+ /// Converts a [`ReducerBudget`] to a [`Duration`].
227230fn budget_to_duration ( _budget : ReducerBudget ) -> Duration {
228231 // TODO(v8): This is fake logic that allows a maximum timeout.
229232 // Replace with sensible math.
230233 Duration :: MAX
231234}
232235
236+ /// Converts a [`Duration`] to a [`ReducerBudget`].
233237fn duration_to_budget ( _duration : Duration ) -> ReducerBudget {
234238 // TODO(v8): This is fake logic that allows minimum energy usage.
235239 // Replace with sensible math.
You can’t perform that action at this time.
0 commit comments