% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pool.R
\name{pool_dispatch}
\alias{pool_dispatch}
\title{Dispatch Task to Worker}
\usage{
pool_dispatch(
  worker_id,
  expr,
  envir = parent.frame(),
  pool = NULL,
  timeout = 3600
)
}
\arguments{
\item{worker_id}{Integer. Worker to dispatch to.}

\item{expr}{Expression to evaluate.}

\item{envir}{Environment containing variables needed by expr.}

\item{pool}{A \code{shard_pool} object. If NULL, uses the current pool.}

\item{timeout}{Numeric. Seconds to wait for result (default 3600).}
}
\value{
The result of evaluating expr in the worker.
}
\description{
Sends a task to a specific worker and waits for the result.
}
\examples{
\donttest{
p <- pool_create(2)
pool_dispatch(1, quote(1 + 1), pool = p)
pool_stop(p)
}
}
