You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before working on #2180 we need to address situation with resource table. Resource table is used to store resource ids with their corresponding representations.
all resource related logic lives in cli/resources.rs, instead logic for each kind of resource should live alongside ops code that utilizes it
all representations are hard coded which effectively prohibits splitting ops into separate crates - CLI would still have to be aware what kind of resource each op can use
We want ResourceTable to expose public API allowing op crates to register any resources they see fit to utilize (eg. process crate would implement resources analogous to Repr::Child, Repr:ChildStdin, Repr:ChildStdout and Repr:ChildStderr).
That means that ResourceTable should be a struct mapping resource ids to boxed trait objects. The trait could be as simple as:
Trait objects from ResourceTable would then be upcasted into concrete type inside the op.
New resource table should be a core concept. It should be first implemented for deno_core_http_bench, then we should refactor cli::resources::RESOURCE_TABLE.
Before working on #2180 we need to address situation with resource table. Resource table is used to store resource ids with their corresponding representations.
deno/cli/resources.rs
Lines 56 to 104 in b1685ce
There are two problems with this approach:
cli/resources.rs
, instead logic for each kind of resource should live alongside ops code that utilizes itWe want
ResourceTable
to expose public API allowing op crates to register any resources they see fit to utilize (eg.process
crate would implement resources analogous toRepr::Child
,Repr:ChildStdin
,Repr:ChildStdout
andRepr:ChildStderr
).That means that
ResourceTable
should be a struct mapping resource ids to boxed trait objects. The trait could be as simple as:Trait objects from
ResourceTable
would then be upcasted into concrete type inside the op.New resource table should be a
core
concept. It should be first implemented fordeno_core_http_bench
, then we should refactorcli::resources::RESOURCE_TABLE
.I'll be working on it.
CC @ry @piscisaureus
The text was updated successfully, but these errors were encountered: