Search
Preparing search index...
The search index is not available
workestrator
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Globals
"Farm"
Farm
Class Farm
Hierarchy
EventEmitter
Farm
Index
Constructors
constructor
Properties
debug
id
killed
options
pending
Calls
queue
serializer
worker
Counter
workers
default
Max
Listeners
farm
Count
Methods
add
Listener
broadcast
broadcast
Method
create
Workers
dispatch
emit
event
Names
get
Available
Worker
get
Max
Listeners
get
Worker
ById
init
is
Pool
Available
kill
listen
ToWorker
listener
Count
listeners
off
on
once
prepend
Listener
prepend
Once
Listener
process
Queue
raw
Listeners
receive
remove
All
Listeners
remove
Call
From
Pending
remove
Listener
rotate
Worker
run
run
Method
set
Max
Listeners
listener
Count
Constructors
constructor
new
Farm
(
options
:
InternalFarmOptions
)
:
Farm
Parameters
options:
InternalFarmOptions
Returns
Farm
Properties
Private
debug
debug
:
logger.IDebugger
id
id
:
number
killed
killed
:
boolean
= false
options
options
:
InternalFarmOptions
pending
Calls
pending
Calls
:
Call
[]
= []
queue
queue
:
Call
[]
= []
Private
serializer
serializer
:
Serializer
Private
worker
Counter
worker
Counter
:
number
= 0
workers
workers
:
Worker
[]
= []
Static
default
Max
Listeners
default
Max
Listeners
:
number
Static
Private
farm
Count
farm
Count
:
number
= 0
Methods
add
Listener
add
Listener
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
broadcast
broadcast
(
...
args
:
any
[]
)
:
Promise
<
any
[]
>
Parameters
Rest
...
args:
any
[]
Returns
Promise
<
any
[]
>
broadcast
Method
broadcast
Method
(
method
?:
undefined
|
string
,
...
args
:
any
[]
)
:
Promise
<
[
any
[]
,
Error
[]
]
>
Parameters
Optional
method:
undefined
|
string
Rest
...
args:
any
[]
Returns
Promise
<
[
any
[]
,
Error
[]
]
>
create
Workers
create
Workers
(
)
:
void
Returns
void
Private
dispatch
dispatch
(
options
:
CallOptions
)
:
Promise
<
any
>
Parameters
options:
CallOptions
Returns
Promise
<
any
>
emit
emit
(
event
:
string
|
symbol
,
...
args
:
any
[]
)
:
boolean
Parameters
event:
string
|
symbol
Rest
...
args:
any
[]
Returns
boolean
event
Names
event
Names
(
)
:
Array
<
string
|
symbol
>
Returns
Array
<
string
|
symbol
>
Private
get
Available
Worker
get
Available
Worker
(
)
:
Worker
|
void
Returns
Worker
|
void
get
Max
Listeners
get
Max
Listeners
(
)
:
number
Returns
number
Private
get
Worker
ById
get
Worker
ById
(
id
:
any
)
:
Worker
|
void
Parameters
id:
any
Returns
Worker
|
void
Private
init
init
(
)
:
void
Returns
void
Private
is
Pool
Available
is
Pool
Available
(
)
:
boolean
Returns
boolean
kill
kill
(
)
:
void
Returns
void
Private
listen
ToWorker
listen
ToWorker
(
worker
:
Worker
)
:
void
Parameters
worker:
Worker
Returns
void
listener
Count
listener
Count
(
type
:
string
|
symbol
)
:
number
Parameters
type:
string
|
symbol
Returns
number
listeners
listeners
(
event
:
string
|
symbol
)
:
Function
[]
Parameters
event:
string
|
symbol
Returns
Function
[]
off
off
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
on
on
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
once
once
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
prepend
Listener
prepend
Listener
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
prepend
Once
Listener
prepend
Once
Listener
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
Private
process
Queue
process
Queue
(
)
:
void
Returns
void
raw
Listeners
raw
Listeners
(
event
:
string
|
symbol
)
:
Function
[]
Parameters
event:
string
|
symbol
Returns
Function
[]
Private
receive
receive
(
data
:
WorkerToMasterMessage
)
:
void
Parameters
data:
WorkerToMasterMessage
Returns
void
remove
All
Listeners
remove
All
Listeners
(
event
?:
string
|
symbol
)
:
this
Parameters
Optional
event:
string
|
symbol
Returns
this
Private
remove
Call
From
Pending
remove
Call
From
Pending
(
callId
:
number
)
:
Call
|
void
Parameters
callId:
number
Returns
Call
|
void
remove
Listener
remove
Listener
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
Private
rotate
Worker
rotate
Worker
(
id
:
number
)
:
void
Will remove a worker from the farm and create a new one
Parameters
id:
number
Returns
void
run
run
(
...
args
:
any
[]
)
:
Promise
<
any
>
Parameters
Rest
...
args:
any
[]
Returns
Promise
<
any
>
run
Method
run
Method
(
method
?:
undefined
|
string
,
...
args
:
any
[]
)
:
Promise
<
any
>
Parameters
Optional
method:
undefined
|
string
Rest
...
args:
any
[]
Returns
Promise
<
any
>
set
Max
Listeners
set
Max
Listeners
(
n
:
number
)
:
this
Parameters
n:
number
Returns
this
Static
listener
Count
listener
Count
(
emitter
:
EventEmitter
, event
:
string
|
symbol
)
:
number
deprecated
since v4.0.0
Parameters
emitter:
EventEmitter
event:
string
|
symbol
Returns
number
Globals
"
Call"
"
Call
Max
Retry
Error"
"
Farm"
"
Max
Concurrent
Calls
Error"
"
Timeout
Error"
"
Worker
Terminated
Error"
"index"
"types"
"utils"
"worker/
Worker"
"worker/executor"
"worker/serializer/CBOR"
"worker/serializer/JSON"
"worker/serializer/
Serializer"
Farm
constructor
debug
id
killed
options
pending
Calls
queue
serializer
worker
Counter
workers
default
Max
Listeners
farm
Count
add
Listener
broadcast
broadcast
Method
create
Workers
dispatch
emit
event
Names
get
Available
Worker
get
Max
Listeners
get
Worker
ById
init
is
Pool
Available
kill
listen
ToWorker
listener
Count
listeners
off
on
once
prepend
Listener
prepend
Once
Listener
process
Queue
raw
Listeners
receive
remove
All
Listeners
remove
Call
From
Pending
remove
Listener
rotate
Worker
run
run
Method
set
Max
Listeners
listener
Count
Generated using
TypeDoc
Will remove a worker from the farm and create a new one