% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/starburst-map.R
\name{starburst_map}
\alias{starburst_map}
\title{Map a Function Over Data on AWS Workers}
\usage{
starburst_map(
  .x,
  .f,
  workers = 10,
  cpu = 4,
  memory = "8GB",
  region = NULL,
  timeout = 3600,
  launch_type = "EC2",
  instance_type = "c7g.xlarge",
  use_spot = TRUE,
  .progress = TRUE,
  ...
)
}
\arguments{
\item{.x}{A vector or list to iterate over}

\item{.f}{A function to apply to each element}

\item{workers}{Number of parallel workers (default: 10)}

\item{cpu}{CPU units per worker (1, 2, 4, 8, or 16)}

\item{memory}{Memory per worker (e.g., 8GB)}

\item{region}{AWS region}

\item{timeout}{Maximum runtime in seconds per task}

\item{launch_type}{Compute backend: "EC2" (default) or "FARGATE"}

\item{instance_type}{EC2 instance type when \code{launch_type = "EC2"}
(default: "c7g.xlarge"). The worker CPU architecture follows the instance
type — Graviton types (e.g. \code{c7g.*}) run ARM64, Intel/AMD types
(e.g. \code{c7i.*}) run x86_64 — so there is no separate platform argument.}

\item{use_spot}{Use EC2 Spot instances for cost savings (default: TRUE)}

\item{.progress}{Show progress bar (default: TRUE)}

\item{...}{Additional arguments passed to .f}
}
\value{
A list of results, one per element of .x
}
\description{
Parallel map function that executes across AWS workers (EC2 by default, or
Fargate) using the staRburst Future backend.
}
\examples{
\donttest{
if (starburst_is_configured()) {
  # Simple parallel computation
  results <- starburst_map(1:100, function(x) x^2, workers = 10)

  # With custom configuration
  results <- starburst_map(
    data_list,
    expensive_function,
    workers = 50,
    cpu = 4,
    memory = "8GB"
  )

  # Use the Fargate backend instead of the EC2 default
  results <- starburst_map(1:100, function(x) x^2,
                           workers = 10, launch_type = "FARGATE")
}
}
}
