-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
74 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
tnode | ||
low_level | ||
assignments | ||
task | ||
backend_types | ||
backend_utils | ||
cc_backend | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
open Base | ||
module Lazy = Utils.Lazy | ||
module Debug_runtime = Utils.Debug_runtime | ||
|
||
let _get_local_debug_runtime = Utils._get_local_debug_runtime | ||
|
||
[%%global_debug_log_level 9] | ||
[%%global_debug_log_level_from_env_var "OCANNL_LOG_LEVEL"] | ||
|
||
type t = | ||
| Task : { | ||
context_lifetime : ('a[@sexp.opaque]); | ||
description : string; | ||
work : unit -> unit; | ||
} | ||
-> t | ||
[@@deriving sexp_of] | ||
|
||
let describe (Task task) = task.description | ||
|
||
let%diagn_l_sexp run (Task task) = | ||
[%log_result "run", task.description]; | ||
task.work () | ||
|
||
let prepend ~work (Task task) = | ||
Task | ||
{ | ||
task with | ||
work = | ||
(fun () -> | ||
work (); | ||
task.work ()); | ||
} | ||
|
||
let%track3_l_sexp enschedule ~schedule_task ~get_stream_name stream (Task { description; _ } as task) = | ||
[%log_result "enschedule", description, "on", get_stream_name stream]; | ||
let work () = schedule_task stream task in | ||
Task | ||
{ | ||
context_lifetime = task; | ||
description = "schedules {" ^ description ^ "} on " ^ get_stream_name stream; | ||
work; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters