Learn R Programming

future (version 1.1.1)

nbrOfWorkers: Gets the number of workers available

Description

Gets the number of workers available

Usage

nbrOfWorkers(evaluator = NULL)

Arguments

evaluator
A future evaluator function. If NULL (default), the current evaluator as returned by plan() is used.

Value

A number in [1,Inf].

Examples

Run this code
plan(multiprocess)
nbrOfWorkers()  ## == availableCores()

plan(multiprocess, workers=2)
nbrOfWorkers()  ## == 2

plan(lazy)
nbrOfWorkers()  ## == 1

Run the code above in your browser using DataLab