% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GitStats.R
\name{set_parallel}
\alias{set_parallel}
\title{Enable parallel processing}
\usage{
set_parallel(gitstats, workers = 10L)
}
\arguments{
\item{gitstats}{A GitStats object.}

\item{workers}{Number of parallel workers. Set to \code{TRUE} for automatic
detection, a positive integer for a specific count, or \code{FALSE}/\code{0} to
disable parallelism.}
}
\value{
A \code{GitStats} object.
}
\description{
Set up parallel processing for API calls using mirai daemons.
When enabled, GitStats fetches data from multiple repositories
concurrently. Call \code{set_parallel(FALSE)} or \code{set_parallel(0)} to revert
to sequential execution.
}
\examples{
\dontrun{
  my_gitstats <- create_gitstats() |>
    set_github_host(
      token = Sys.getenv("GITHUB_PAT"),
      orgs = c("r-world-devs", "openpharma")
    ) |>
    set_parallel(4)
  get_commits(my_gitstats, since = "2024-01-01")
  my_gitstats |> set_parallel(FALSE) # revert to sequential
}
}
