Skip to content

Commit

Permalink
feat: allow creating an inspector session if using oneshot policy (s…
Browse files Browse the repository at this point in the history
…upabase#245)

* stamp: adding arguments

* fix: emit a warning if specified `max-parallelism` while specified `oneshot` policy

* chore: update dependency

* feat: allow creating an inspector session if using `oneshot` policy

* chore: make clippy happy

* stamp: watching inspector has been disconnected, and then cut the ws connection

* stamp(sb_graph): make mapping the sourcemap correctly

I don't know why the module specifier should be `localhost`, so I modified this
to represent the Real path. If I made a mistake with this change, then correct
me in the conversation.

* stamp: make clippy happy

* stamp: adding default values for the `inspect-*` flags

* stamp: allow inspector connect to main worker

(cherry picked from commit 63e8b0e75be0d6a99c564d478b3dd47313275254)

* stamp: try to terminate the main worker gracefully

(cherry picked from commit 5f3565bad7a86b5ac1cb4440feba6d77f8b18890)

* stamp: make termination routine more reliably

(cherry picked from commit f415e6a3950c5298f5b718d9b783226a78c418ea)

* fix: bump up `tokio` version to `1.35`

(cherry picked from commit 1a02b09b763b9654d7db4b45745fd55731bdf63b)

* stamp(cpu_timer): add a small note

* stamp: add small notes

* stamp: solve rebase conflicts

* stamp: update `Cargo.lock`

* stamp: apply `cargo fmt`

* stamp: waiting and closing inspector sessions more reliably

* stamp: supervisor should be able to stop when an isolate escapes the loop unexpectedly

* stamp: don’t disperse unsafe v8 routines across several code blocks unnecessarily

* fix: don’t cancel the token if not the user worker context

* stamp: make clippy happy

* stamp: update `Cargo.lock`

* stamp: resolve rebase conflicts
  • Loading branch information
nyannyacha committed Feb 27, 2024
1 parent 1399bb2 commit e024cad
Show file tree
Hide file tree
Showing 21 changed files with 1,148 additions and 229 deletions.
20 changes: 19 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ deno_webstorage = { version = "0.131.0" }
enum-as-inner = "0.6.0"
serde = { version = "1.0.149", features = ["derive"] }
hyper = "0.14.26"
tokio = { version = "1.28.1", features = ["full"] }
tokio = { version = "1.35", features = ["full"] }
bytes = { version = "1.4.0" }
once_cell = "1.17.1"
thiserror = "1.0.40"
Expand All @@ -71,6 +71,7 @@ base64 = "0.21.4"
futures = { version = "0.3.28" }
futures-util = { version = "0.3.28" }
ctor = { version = "0.2.6" }
fastwebsockets = { version = "0.4.4", features = ["upgrade"] }
percent-encoding = "=2.3.0"
scopeguard = { version = "1.2.0" }

Expand Down
1 change: 1 addition & 0 deletions crates/base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pin-project = { version = "1.1.3" }
ctor = { workspace = true }
deno_canvas.workspace = true
deno_webgpu.workspace = true
fastwebsockets = { workspace = true }
sb_ai = { version = "0.1.0", path = "../sb_ai" }

[dev-dependencies]
Expand Down
10 changes: 7 additions & 3 deletions crates/base/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::{
inspector_server::Inspector,
rt_worker::{worker_ctx::TerminationToken, worker_pool::WorkerPoolPolicy},
server::{Server, ServerHealth, WorkerEntrypoints},
server::{Server, ServerFlags, ServerHealth, WorkerEntrypoints},
InspectorOption,
};
use anyhow::Error;
use tokio::sync::mpsc::Sender;
Expand All @@ -13,10 +15,11 @@ pub async fn start_server(
event_worker_path: Option<String>,
user_worker_policy: Option<WorkerPoolPolicy>,
import_map_path: Option<String>,
no_module_cache: bool,
flags: ServerFlags,
callback_tx: Option<Sender<ServerHealth>>,
entrypoints: WorkerEntrypoints,
termination_token: Option<TerminationToken>,
inspector_option: Option<InspectorOption>,
) -> Result<(), Error> {
let mut server = Server::new(
ip,
Expand All @@ -25,10 +28,11 @@ pub async fn start_server(
event_worker_path,
user_worker_policy,
import_map_path,
no_module_cache,
flags,
callback_tx,
entrypoints,
termination_token,
inspector_option.map(Inspector::from_option),
)
.await?;

Expand Down
Loading

0 comments on commit e024cad

Please sign in to comment.