vere: refactors ovum scheduling api

This commit is contained in:
Joe Bryan 2020-06-27 00:59:31 -07:00
parent b4ff9888b5
commit 3965b261d1
10 changed files with 20 additions and 29 deletions

View File

@ -842,11 +842,7 @@
/* u3_auto_plan(): create and enqueue an ovum. /* u3_auto_plan(): create and enqueue an ovum.
*/ */
u3_ovum* u3_ovum*
u3_auto_plan(u3_auto* car_u, u3_auto_plan(u3_auto* car_u, u3_ovum* egg_u);
c3_w mil_w,
u3_noun tar,
u3_noun wir,
u3_noun cad);
/* u3_auto_peer(): subscribe to updates. /* u3_auto_peer(): subscribe to updates.
*/ */

View File

@ -22,14 +22,8 @@
/* u3_auto_plan(): create and enqueue an ovum. /* u3_auto_plan(): create and enqueue an ovum.
*/ */
u3_ovum* u3_ovum*
u3_auto_plan(u3_auto* car_u, u3_auto_plan(u3_auto* car_u, u3_ovum *egg_u)
c3_w mil_w,
u3_noun tar,
u3_noun wir,
u3_noun cad)
{ {
u3_ovum *egg_u = u3_ovum_init(mil_w, tar, wir, cad);
egg_u->car_u = car_u; egg_u->car_u = car_u;
// [pre_u] points towards [ext_u] (back in time) // [pre_u] points towards [ext_u] (back in time)

View File

@ -471,7 +471,8 @@ _ames_recv_cb(uv_udp_t* wax_u,
} }
u3_auto_peer( u3_auto_peer(
u3_auto_plan(&sam_u->car_u, 0, c3__a, wir, cad), u3_auto_plan(&sam_u->car_u,
u3_ovum_init(0, c3__a, wir, cad)),
0, _ames_hear_bail); 0, _ames_hear_bail);
_ames_cap_queue(sam_u); _ames_cap_queue(sam_u);
@ -596,7 +597,7 @@ _ames_io_talk(u3_auto* car_u)
u3_noun wir = u3nt(c3__newt, u3k(u3A->sen), u3_nul); u3_noun wir = u3nt(c3__newt, u3k(u3A->sen), u3_nul);
u3_noun cad = u3nc(c3__born, u3_nul); u3_noun cad = u3nc(c3__born, u3_nul);
u3_auto_plan(car_u, 0, c3__a, wir, cad); u3_auto_plan(car_u, u3_ovum_init(0, c3__a, wir, cad));
} }
} }

View File

@ -47,7 +47,7 @@ _behn_time_cb(uv_timer_t* tim_u)
u3_noun wir = u3nc(c3__behn, u3_nul); u3_noun wir = u3nc(c3__behn, u3_nul);
u3_noun cad = u3nc(c3__wake, u3_nul); u3_noun cad = u3nc(c3__wake, u3_nul);
u3_auto_plan(&teh_u->car_u, 0, c3__b, wir, cad); u3_auto_plan(&teh_u->car_u, u3_ovum_init(0, c3__b, wir, cad));
} }
} }
@ -143,7 +143,7 @@ _behn_io_talk(u3_auto* car_u)
u3_noun cad = u3nc(c3__born, u3_nul); u3_noun cad = u3nc(c3__born, u3_nul);
u3_auto_peer( u3_auto_peer(
u3_auto_plan(car_u, 0, c3__b, wir, cad), u3_auto_plan(car_u, u3_ovum_init(0, c3__b, wir, cad)),
_behn_born_news, _behn_born_news,
_behn_born_bail); _behn_born_bail);
} }

View File

@ -721,7 +721,7 @@ _cttp_http_client_receive(u3_creq* ceq_u, c3_w sas_w, u3_noun mes, u3_noun uct)
ceq_u->num_l, ceq_u->num_l,
u3nq(u3i_string("start"), u3nc(sas_w, mes), uct, c3y)); u3nq(u3i_string("start"), u3nc(sas_w, mes), uct, c3y));
u3_auto_plan(&ceq_u->ctp_u->car_u, 0, c3__i, wir, cad); u3_auto_plan(&ceq_u->ctp_u->car_u, u3_ovum_init(0, c3__i, wir, cad));
} }
/* _cttp_creq_fail(): dispatch error response /* _cttp_creq_fail(): dispatch error response
@ -1020,7 +1020,7 @@ _cttp_io_talk(u3_auto* car_u)
u3_noun wir = u3nt(u3i_string("http-client"), u3k(u3A->sen), u3_nul); u3_noun wir = u3nt(u3i_string("http-client"), u3k(u3A->sen), u3_nul);
u3_noun cad = u3nc(c3__born, u3_nul); u3_noun cad = u3nc(c3__born, u3_nul);
u3_auto_plan(car_u, 0, c3__i, wir, cad); u3_auto_plan(car_u, u3_ovum_init(0, c3__i, wir, cad));
} }
/* _cttp_io_kick(): apply effects /* _cttp_io_kick(): apply effects

View File

@ -60,7 +60,7 @@ _fore_inject(u3_auto* car_u, c3_c* pax_c)
} }
u3_auto_peer( u3_auto_peer(
u3_auto_plan(car_u, 0, u3k(tar), u3k(wir), u3k(cad)), u3_auto_plan(car_u, u3_ovum_init(0, u3k(tar), u3k(wir), u3k(cad))),
0, _fore_inject_bail); 0, _fore_inject_bail);
} }
@ -83,7 +83,7 @@ _fore_io_talk(u3_auto* car_u)
wir = u3nc(c3__arvo, u3_nul); wir = u3nc(c3__arvo, u3_nul);
cad = u3nc(c3__wack, u3i_words(16, eny_w)); cad = u3nc(c3__wack, u3i_words(16, eny_w));
u3_auto_plan(car_u, 0, u3_blip, wir, cad); u3_auto_plan(car_u, u3_ovum_init(0, u3_blip, wir, cad));
} }
// set verbose as per -v // set verbose as per -v
@ -96,7 +96,7 @@ _fore_io_talk(u3_auto* car_u)
wir = u3nt(c3__term, '1', u3_nul); wir = u3nt(c3__term, '1', u3_nul);
cad = u3nc(c3__verb, u3_nul); cad = u3nc(c3__verb, u3_nul);
u3_auto_plan(car_u, 0, u3_blip, wir, cad); u3_auto_plan(car_u, u3_ovum_init(0, u3_blip, wir, cad));
} }
// inject arbitrary // inject arbitrary

View File

@ -45,7 +45,7 @@ _hind_io_kick(u3_auto* car_u, u3_noun wir, u3_noun cad)
// //
case c3__trim: { case c3__trim: {
ret_o = c3y; ret_o = c3y;
u3_auto_plan(car_u, 0, u3_blip, u3k(wir), u3k(cad)); u3_auto_plan(car_u, u3_ovum_init(0, u3_blip, u3k(wir), u3k(cad)));
} }
case c3__vega: { case c3__vega: {

View File

@ -382,7 +382,7 @@ _http_req_kill(u3_hreq* req_u)
u3_noun wir = _http_req_to_duct(req_u); u3_noun wir = _http_req_to_duct(req_u);
u3_noun cad = u3nc(u3i_string("cancel-request"), u3_nul); u3_noun cad = u3nc(u3i_string("cancel-request"), u3_nul);
u3_auto_plan(&htd_u->car_u, 0, c3__e, wir, cad); u3_auto_plan(&htd_u->car_u, u3_ovum_init(0, c3__e, wir, cad));
} }
typedef struct _u3_hgen { typedef struct _u3_hgen {
@ -475,7 +475,7 @@ _http_req_dispatch(u3_hreq* req_u, u3_noun req)
: u3nc(u3i_string("request"), dat); : u3nc(u3i_string("request"), dat);
} }
u3_auto_plan(&htd_u->car_u, 0, c3__e, wir, cad); u3_auto_plan(&htd_u->car_u, u3_ovum_init(0, c3__e, wir, cad));
} }
} }
@ -1556,7 +1556,7 @@ _http_serv_start_all(u3_httd* htd_u)
u3_noun wir = u3nt(u3i_string("http-server"), u3k(u3A->sen), u3_nul); u3_noun wir = u3nt(u3i_string("http-server"), u3k(u3A->sen), u3_nul);
u3_noun cad = u3nt(c3__live, non, sec); u3_noun cad = u3nt(c3__live, non, sec);
u3_auto_plan(&htd_u->car_u, 0, c3__e, wir, cad); u3_auto_plan(&htd_u->car_u, u3_ovum_init(0, c3__e, wir, cad));
} }
_http_write_ports_file(htd_u, u3_Host.dir_c); _http_write_ports_file(htd_u, u3_Host.dir_c);
@ -1668,7 +1668,7 @@ _http_io_talk(u3_auto* car_u)
u3_noun wir = u3nt(u3i_string("http-server"), u3k(u3A->sen), u3_nul); u3_noun wir = u3nt(u3i_string("http-server"), u3k(u3A->sen), u3_nul);
u3_noun cad = u3nc(c3__born, u3_nul); u3_noun cad = u3nc(c3__born, u3_nul);
u3_auto_plan(car_u, 0, c3__e, wir, cad); u3_auto_plan(car_u, u3_ovum_init(0, c3__e, wir, cad));
// XX set liv_o on done/swap? // XX set liv_o on done/swap?
// //

View File

@ -607,7 +607,7 @@ _term_it_save(u3_noun pax, u3_noun pad)
static u3_ovum* static u3_ovum*
_term_ovum_plan(u3_auto* car_u, u3_noun wir, u3_noun cad) _term_ovum_plan(u3_auto* car_u, u3_noun wir, u3_noun cad)
{ {
u3_ovum* egg_u = u3_auto_plan(car_u, 0, c3__d, wir, cad); u3_ovum* egg_u = u3_auto_plan(car_u, u3_ovum_init(0, c3__d, wir, cad));
// term events have no spinner label // term events have no spinner label
// //

View File

@ -959,7 +959,7 @@ _unix_update_mount(u3_unix* unx_u, u3_umon* mon_u, u3_noun all)
u3_noun wir = u3nt(c3__sync, u3k(u3A->sen), u3_nul); u3_noun wir = u3nt(c3__sync, u3k(u3A->sen), u3_nul);
u3_noun cad = u3nq(c3__into, u3i_string(mon_u->nam_c), all, can); u3_noun cad = u3nq(c3__into, u3i_string(mon_u->nam_c), all, can);
u3_auto_plan(&unx_u->car_u, 0, c3__c, wir, cad); u3_auto_plan(&unx_u->car_u, u3_ovum_init(0, c3__c, wir, cad));
} }
} }
} }
@ -1377,7 +1377,7 @@ _unix_io_talk(u3_auto* car_u)
u3_noun wir = u3nc(c3__boat, u3_nul); u3_noun wir = u3nc(c3__boat, u3_nul);
u3_noun cad = u3nc(c3__boat, u3_nul); u3_noun cad = u3nc(c3__boat, u3_nul);
u3_auto_plan(car_u, 0, c3__c, wir, cad); u3_auto_plan(car_u, u3_ovum_init(0, c3__c, wir, cad));
} }
/* _unix_io_kick(): apply effects. /* _unix_io_kick(): apply effects.