pub struct WorkerClient {
pub socket_path: PathBuf,
/* private fields */
}Fields§
§socket_path: PathBufImplementations§
Source§impl WorkerClient
impl WorkerClient
Sourcepub async fn spawn(
socket_path: PathBuf,
manifest_path: &Path,
worker_entry: &Path,
config_path: Option<&Path>,
) -> Result<Self, WorkerError>
pub async fn spawn( socket_path: PathBuf, manifest_path: &Path, worker_entry: &Path, config_path: Option<&Path>, ) -> Result<Self, WorkerError>
Spawn a Bun worker and connect over UDS. Returns after the worker sends
its ready lifecycle message.
Sourcepub async fn ping(&self) -> Result<(), WorkerError>
pub async fn ping(&self) -> Result<(), WorkerError>
Send a ping and wait up to 5 s for a pong.
Sourcepub async fn drain(&self) -> Result<(), WorkerError>
pub async fn drain(&self) -> Result<(), WorkerError>
Ask the worker to finish in-flight renders and then exit gracefully.
Sourcepub async fn render(
&self,
id: u32,
route: &str,
req: Value,
deadline_ms: u64,
) -> Result<RenderResult, WorkerError>
pub async fn render( &self, id: u32, route: &str, req: Value, deadline_ms: u64, ) -> Result<RenderResult, WorkerError>
Invoke render on the worker (used by Mode 2 in P9+; stubbed at 501 in P7).
Sourcepub async fn kill(&self) -> Result<()>
pub async fn kill(&self) -> Result<()>
Kill the worker process immediately (no graceful drain).
Sourcepub async fn wait(&self) -> Result<ExitStatus>
pub async fn wait(&self) -> Result<ExitStatus>
Wait for the worker process to exit.
Auto Trait Implementations§
impl !Freeze for WorkerClient
impl !RefUnwindSafe for WorkerClient
impl !UnwindSafe for WorkerClient
impl Send for WorkerClient
impl Sync for WorkerClient
impl Unpin for WorkerClient
impl UnsafeUnpin for WorkerClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more