-
Notifications
You must be signed in to change notification settings - Fork 30
Queen Instance API
This is a simplified version of the Server API to help beginners.
When you run a Queen script by executing something like queen my-queen-script.js
or queen-remote -h queenserver.example.com my-queen-script.js
run (Array, required) An ordered array of URLs for scripts the workers will load. killOnStop (boolean, default=true) Whether the workforce should kill itself as soon as it's worker count reaches 0 populate (String, default="once") "manual": The workforce will not be automatically populated. "once": The workforce will be populated by all currently available worker providers. "continuous": The workforce will be populated by all currently available worker providers AND all future worker providers. timeout (Number, default=Infinity) The number of milliseconds each worker has until it's .kill()'d automatically. handler (Function(Worker)) A function which receives any workers which are added to the workforce. stop (Function()) A function which gets called when all workforce no longer has any workers connected. autoStart (Boolean, default=true) Whether the workforce should start immediately. If not, need to manually call the .start() method. filter (Function(WorkerProviderAttributes)) A filter function which returns true or false given a worker provider, determining whether the workforce should attempt to get workers from that provider. uniqueness (Function(WorkerProviderAttributes)) A function which returns a string to use to determine if two browsers should be considered the "same" and therefore, only one will end up executing the test. This means if the function returned the browser family name, only one browser connected per browser family will run this script. Returns: Workforce The workforce for the given worker config