Learn R Programming

gooseR (version 0.1.2)

WorkerPool: Worker Pool R6 Class

Description

Worker Pool R6 Class

Worker Pool R6 Class

Arguments

Public fields

n_workers

Number of workers

queue

Query queue

results

Results list

active

Whether pool is active Initialize worker pool

Methods


Method new()

Usage

WorkerPool$new(n_workers = 4)

Arguments

n_workers

Number of workers Add query to queue


Method add()

Usage

WorkerPool$add(query, id = NULL)

Arguments

query

Query to add

id

Optional query ID Process all queued queries


Method process()

Usage

WorkerPool$process(progress = TRUE)

Arguments

progress

Show progress

Returns

List of results Get results


Method get_results()

Usage

WorkerPool$get_results()

Returns

Results list Clear queue


Method clear_queue()

Remove all queued items without processing them.

Usage

WorkerPool$clear_queue()

Returns

Invisible self Shutdown pool


Method shutdown()

Shut down the worker pool and reset the future plan to sequential.

Usage

WorkerPool$shutdown()

Returns

Invisible self


Method clone()

The objects of this class are cloneable with this method.

Usage

WorkerPool$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Manages a pool of async workers