| Team {Streamer} | R Documentation |
A Consumer to divide incoming tasks amongst
processes for parallel evaluation; not supported on Windows.
Team(FUN, ..., param)
FUN |
A |
... |
Additional arguments (e.g., |
param |
If provided, a |
Use Team to construct instances of this class.
When param is missing, Team consults the registry (see
register) for a parallel parameter class. If none is
found and .Platform$OS.type == "unix", a default
MulticoreParam instance is used. An error is signaled on
other operating systems (i.e., Windows)
See Consumer Methods.
Internal fields of this class are are described with, e.g.,
getRefClass("MulticoreTeam")$fields.
Internal methods of this class are described with
getRefClass("MulticoreTeam")$methods() and
getRefClass("MulticoreTeam")$help().
Martin Morgan mtmorgan@fhcrc.org
ParallelParam for configuring parallel
environments. DAGTeam apply functions organized as a
directed acyclic graph.
if (.Platform$OS.type != "windows") {
param <- MulticoreParam(size=5)
team <- Team(function(x) { Sys.sleep(1); mean(x) }, param=param)
s <- Stream(Seq(to=50, yieldSize=5), team)
system.time({while(length(y <- yield(s)))
print(y)
}) ## about 2 seconds
}