2018-09-19 15:22:17 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< title > TorPool - Documentation< / title >
< script src = "scripts/prettify/prettify.js" > < / script >
< script src = "scripts/prettify/lang-css.js" > < / script >
<!-- [if lt IE 9]>
< script src = "//html5shiv.googlecode.com/svn/trunk/html5.js" > < / script >
<![endif]-->
< link type = "text/css" rel = "stylesheet" href = "styles/prettify.css" >
< link type = "text/css" rel = "stylesheet" href = "styles/jsdoc.css" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< / head >
< body >
< input type = "checkbox" id = "nav-trigger" class = "nav-trigger" / >
< label for = "nav-trigger" class = "navicon-button x" >
< div class = "navicon" > < / div >
< / label >
< label for = "nav-trigger" class = "overlay" > < / label >
< nav >
< h2 > < a href = "index.html" > Home< / a > < / h2 > < h3 > Classes< / h3 > < ul > < li > < a href = "ControlServer.html" > ControlServer< / a > < ul class = 'methods' > < li data-type = 'method' > < a href = "ControlServer.html#.instance_info" > instance_info< / a > < / li > < li data-type = 'method' > < a href = "ControlServer.html#close" > close< / a > < / li > < li data-type = 'method' > < a href = "ControlServer.html#createDNSServer" > createDNSServer< / a > < / li > < li data-type = 'method' > < a href = "ControlServer.html#createHTTPServer" > createHTTPServer< / a > < / li > < li data-type = 'method' > < a href = "ControlServer.html#createSOCKSServer" > createSOCKSServer< / a > < / li > < li data-type = 'method' > < a href = "ControlServer.html#createTorPool" > createTorPool< / a > < / li > < li data-type = 'method' > < a href = "ControlServer.html#listen" > listen< / a > < / li > < li data-type = 'method' > < a href = "ControlServer.html#listenTcp" > listenTcp< / a > < / li > < li data-type = 'method' > < a href = "ControlServer.html#listenWs" > listenWs< / a > < / li > < / ul > < / li > < li > < a href = "DNSServer.html" > DNSServer< / a > < ul class = 'methods' > < li data-type = 'method' > < a href = "DNSServer.html#listen" > listen< / a > < / li > < / ul > < / li > < li > < a href = "HTTPServer.html" > HTTPServer< / a > < ul class = 'methods' > < li data-type = 'method' > < a href = "HTTPServer.html#listen" > listen< / a > < / li > < / ul > < / li > < li > < a href = "SOCKSServer.html" > SOCKSServer< / a > < ul class = 'methods' > < li data-type = 'method' > < a href = "SOCKSServer.html#listen" > listen< / a > < / li > < / ul > < / li > < li > < a href = "TorPool.html" > TorPool< / a > < ul class = 'methods' > < li data-type = 'method' > < a href = "TorPool.html#add" > add< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#add_instance_to_group" > add_instance_to_group< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#add_instance_to_group_at" > add_instance_to_group_at< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#add_instance_to_group_by_name" > add_instance_to_group_by_name< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#create" > create< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#create_instance" > create_instance< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#exit" > exit< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#get_config_at" > get_config_at< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#get_config_by_name" > get_config_by_name< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#instance_at" > instance_at< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#instance_by_name" > instance_by_name< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#instances_by_group" > instances_by_group< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#new_identites" > new_identites< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#new_identites_by_group" > new_identites_by_group< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#new_identity_at" > new_identity_at< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#new_identity_by_name" > new_identity_by_name< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#next" > next< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#next_by_group" > next_by_group< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#remove" > remove< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#remove_at" > remove_at< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#remove_by_name" > remove_by_name< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#remove_instance_from_group" > remove_instance_from_group< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#remove_instance_from_group_at" > remove_instance_from_group_at< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#remove_instance_from_group_by_name" > remove_instance_from_group_by_name< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#set_config_all" > set_config_all< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#set_config_at" > set_config_at< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#set_config_by_group" > set_config_by_group< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#set_config_by_name" > set_config_by_name< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#signal_all" > signal_all< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#signal_at" > signal_at< / a > < / li > < li data-type = 'method' > < a href = "TorPool.html#signal_by_group" > signal_by_group< / a > < /li
< / nav >
< div id = "main" >
< h1 class = "page-title" > TorPool< / h1 >
< section >
< header >
< h2 >
TorPool
< / h2 >
< div class = "class-description" > Class that represents a pool of Tor processes.< / div >
< / header >
< article >
< div class = "container-overview" >
< h2 > Constructor< / h2 >
< h4 class = "name" id = "TorPool" > < span class = "type-signature" > < / span > new TorPool< span class = "signature" > (tor_path, default_config< span class = "signature-attributes" > opt< / span > , data_directory, load_balance_method, granax_options< span class = "signature-attributes" > opt< / span > , logger< span class = "signature-attributes" > opt< / span > )< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line38" > line 38< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Creates an instance of `TorPool`.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Attributes< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > tor_path< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "description last" > Path to the Tor executable.< / td >
< / tr >
< tr >
< td class = "name" > < code > default_config< / code > < / td >
< td class = "type" >
< span class = "param-type" > Object< / span >
|
< span class = "param-type" > function< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "description last" > Default configuration that will be passed to all Tor instances created. Can be a function. See < a href = "https://bit.ly/2QrmI3o" > Tor Documentation< / a > for all possible options< / td >
< / tr >
< tr >
< td class = "name" > < code > data_directory< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "description last" > Parent directory for the data directory of each proccess.< / td >
< / tr >
< tr >
< td class = "name" > < code > load_balance_method< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "description last" > Name of the load balance method to use. See TorPool#load_balance_methods.< / td >
< / tr >
< tr >
< td class = "name" > < code > granax_options< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "description last" > Object containing options that will be passed to granax for each instance.< / td >
< / tr >
< tr >
< td class = "name" > < code > logger< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "description last" > A winston logger. If not provided no logging will occur.< / td >
< / tr >
< / tbody >
< / table >
< / div >
< h3 class = "subsection-title" > Extends< / h3 >
< ul >
< li > EventEmitter< / li >
< / ul >
< h3 class = "subsection-title" > Members< / h3 >
< h4 class = "name" id = ".load_balance_methods" > < span class = "type-signature" > (static, readonly) < / span > load_balance_methods< span class = "type-signature" > :function< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line350" > line 350< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Returns an enumeration of load balance methods as functions
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > function< / span >
< / li >
< / ul >
< h4 class = "name" id = "data_directory" > < span class = "type-signature" > < / span > data_directory< span class = "type-signature" > :string< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line63" > line 63< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Parent directory for the data directory of each proccess.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > string< / span >
< / li >
< / ul >
< h4 class = "name" id = "default_tor_config" > < span class = "type-signature" > < / span > default_tor_config< span class = "type-signature" > :Object|function< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line327" > line 327< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Getter
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > Object< / span >
|
< span class = "param-type" > function< / span >
< / li >
< / ul >
< h4 class = "name" id = "default_tor_config" > < span class = "type-signature" > < / span > default_tor_config< span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line341" > line 341< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Setter
< / div >
< h4 class = "name" id = "granax_options" > < span class = "type-signature" > < / span > granax_options< span class = "type-signature" > :Logger< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line91" > line 91< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Object containing options that will be passed to granax for each instance.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > Logger< / span >
< / li >
< / ul >
< h4 class = "name" id = "group_names" > < span class = "type-signature" > (readonly) < / span > group_names< span class = "type-signature" > :Set.< string>< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line100" > line 100< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Returns a Set containing the names of all of the groups.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > Set.< string>< / span >
< / li >
< / ul >
< h4 class = "name" id = "groups" > < span class = "type-signature" > (readonly) < / span > groups< span class = "type-signature" > :< a href = "global.html#InstanceGroupCollection" > InstanceGroupCollection< / a > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line238" > line 238< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Represents all groups currently in the pool.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > < a href = "global.html#InstanceGroupCollection" > InstanceGroupCollection< / a > < / span >
< / li >
< / ul >
< h4 class = "name" id = "instance_names" > < span class = "type-signature" > (readonly) < / span > instance_names< span class = "type-signature" > :< a href = "Array.html" > Array< / a > .< string>< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line386" > line 386< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
An array containing the names of the instances in the pool.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > < a href = "Array.html" > Array< / a > .< string>< / span >
< / li >
< / ul >
< h4 class = "name" id = "instances" > < span class = "type-signature" > (readonly) < / span > instances< span class = "type-signature" > :< a href = "Array.html" > Array< / a > .< < a href = "TorProcess.html" > TorProcess< / a > >< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line376" > line 376< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
An array containing all instances in the pool.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > < a href = "Array.html" > Array< / a > .< < a href = "TorProcess.html" > TorProcess< / a > >< / span >
< / li >
< / ul >
< h4 class = "name" id = "load_balance_method" > < span class = "type-signature" > < / span > load_balance_method< span class = "type-signature" > :string< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line70" > line 70< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Name of the load balance method to use.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > string< / span >
< / li >
< / ul >
< h4 class = "name" id = "logger" > < span class = "type-signature" > < / span > logger< span class = "type-signature" > :Logger< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line84" > line 84< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
The winston logger.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > Logger< / span >
< / li >
< / ul >
< h4 class = "name" id = "tor_path" > < span class = "type-signature" > < / span > tor_path< span class = "type-signature" > :string< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line77" > line 77< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Path to the Tor executable.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > string< / span >
< / li >
< / ul >
< h3 class = "subsection-title" > Methods< / h3 >
< h4 class = "name" id = "add" > < span class = "type-signature" > (async) < / span > add< span class = "signature" > (instance_definitions)< / span > < span class = "type-signature" > → {Promise.< < a href = "Array.html" > Array< / a > .< < a href = "TorProcess.html" > TorProcess< / a > >>}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line443" > line 443< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Adds one or more instances to the pool from an array of definitions or single definition.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > instance_definitions< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Array.html" > Array< / a > .< < a href = "global.html#InstanceDefinition" > InstanceDefinition< / a > >< / span >
|
< span class = "param-type" > < a href = "global.html#InstanceDefinition" > InstanceDefinition< / a > < / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
If `instance_definitions` is falsy.
< / div >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< < a href = "Array.html" > Array< / a > .< < a href = "TorProcess.html" > TorProcess< / a > >>< / span >
< / dd >
< / dl >
< h4 class = "name" id = "add_instance_to_group" > < span class = "type-signature" > < / span > add_instance_to_group< span class = "signature" > (group, instance)< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line132" > line 132< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Adds an instance to a group. If the group doesn't exist it will be created.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The group to add the instance to.< / td >
< / tr >
< tr >
< td class = "name" > < code > instance< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "TorProcess.html" > TorProcess< / a > < / span >
< / td >
< td class = "description last" > The instance in question.< / td >
< / tr >
< / tbody >
< / table >
< h4 class = "name" id = "add_instance_to_group_at" > < span class = "type-signature" > < / span > add_instance_to_group_at< span class = "signature" > (group, instance_index)< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line160" > line 160< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Adds an instance to a group by the index of the instance in the pool. If the group doesn't exist it will be created.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The group to add the instance to.< / td >
< / tr >
< tr >
< td class = "name" > < code > instance_index< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > The index of the instance in question.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
If an instance with the index provided does not exist.
< / div >
< h4 class = "name" id = "add_instance_to_group_by_name" > < span class = "type-signature" > < / span > add_instance_to_group_by_name< span class = "signature" > (group, instance_name)< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line144" > line 144< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Adds an instance to a group by the < a href = "TorProcess.html#instance_name" > TorProcess#instance_name< / a > property on the instance. If the group doesn't exist it will be created.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The group to add the instance to.< / td >
< / tr >
< tr >
< td class = "name" > < code > instance_name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The name of the instance in question.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
If an instance with the name provided does not exist
< / div >
< h4 class = "name" id = "create" > < span class = "type-signature" > (async) < / span > create< span class = "signature" > (instance_definitions)< / span > < span class = "type-signature" > → {Promise.< < a href = "Array.html" > Array< / a > .< < a href = "TorProcess.html" > TorProcess< / a > >>}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line459" > line 459< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Creates one or more instances to the pool from either an array of definitions, a single definition or a number.
If a number is provided it will create n instances with empty definitions (e.g. `TorPool.create(5)` will create 5 instances).
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > instance_definitions< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "Array.html" > Array< / a > .< < a href = "global.html#InstanceDefinition" > InstanceDefinition< / a > >< / span >
|
< span class = "param-type" > < a href = "global.html#InstanceDefinition" > InstanceDefinition< / a > < / span >
|
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
If `instances` is falsy.
< / div >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< < a href = "Array.html" > Array< / a > .< < a href = "TorProcess.html" > TorProcess< / a > >>< / span >
< / dd >
< / dl >
< h4 class = "name" id = "create_instance" > < span class = "type-signature" > (async) < / span > create_instance< span class = "signature" > (instance_definition< span class = "signature-attributes" > opt< / span > )< / span > < span class = "type-signature" > → {Promise.< < a href = "TorProcess.html" > TorProcess< / a > >}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line400" > line 400< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Creates an instance then adds it to the pool from the provided definiton.
Instance will be added (and Promise will resolve) after the instance is fully bootstrapped.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Attributes< / th >
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > instance_definition< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "global.html#InstanceDefinition" > InstanceDefinition< / a > < / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
< code > {}< / code >
< / td >
< td class = "description last" > Instance definition that will be used to create the instance.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
If an instance with the same InstanceDefinition#Name already exists.
< / div >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- The instance that was created.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< < a href = "TorProcess.html" > TorProcess< / a > >< / span >
< / dd >
< / dl >
< h4 class = "name" id = "exit" > < span class = "type-signature" > (async) < / span > exit< span class = "signature" > ()< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line561" > line 561< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Kills the Tor processes of all instances in the pool.
< / div >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Resolves when all instances have been killed.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "get_config_at" > < span class = "type-signature" > (async) < / span > get_config_at< span class = "signature" > (index, keyword)< / span > < span class = "type-signature" > → {Promise.< < a href = "Array.html" > Array< / a > .< string>>}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line663" > line 663< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Get a configuration value from the instance at the index in the pool via the control protocol.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > index< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > Index of the instance in the pool.< / td >
< / tr >
< tr >
< td class = "name" > < code > keyword< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the configuration property.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
When no instance exists at the provided index.
< / div >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- The configuration property's value.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< < a href = "Array.html" > Array< / a > .< string>>< / span >
< / dd >
< / dl >
< h4 class = "name" id = "get_config_by_name" > < span class = "type-signature" > (async) < / span > get_config_by_name< span class = "signature" > (name, keyword)< / span > < span class = "type-signature" > → {Promise.< < a href = "Array.html" > Array< / a > .< string>>}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line626" > line 626< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Get a configuration value from the instance whose TorProcess.instance_name matches the provided name via the control protocol.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the instance.< / td >
< / tr >
< tr >
< td class = "name" > < code > keyword< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the configuration property.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
When no instance matched the provided name.
< / div >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- The configuration property's value.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< < a href = "Array.html" > Array< / a > .< string>>< / span >
< / dd >
< / dl >
< h4 class = "name" id = "instance_at" > < span class = "type-signature" > < / span > instance_at< span class = "signature" > (index)< / span > < span class = "type-signature" > → {< a href = "TorProcess.html" > TorProcess< / a > }< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line484" > line 484< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Returns the instance located at the provided index in the pool.
Is equivalent to `< a href = "TorPool.html#instances" > TorPool#instances< / a > [index]`
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > index< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > Index of the instance in the pool< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Matching instance
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > < a href = "TorProcess.html" > TorProcess< / a > < / span >
< / dd >
< / dl >
< h4 class = "name" id = "instance_by_name" > < span class = "type-signature" > < / span > instance_by_name< span class = "signature" > (name)< / span > < span class = "type-signature" > → {< a href = "TorProcess.html" > TorProcess< / a > }< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line474" > line 474< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Searches for an instance with the matching < a href = "TorProcess.html#instance_name" > TorProcess#instance_name< / a > property.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the instance to search for< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Matching instance
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > < a href = "TorProcess.html" > TorProcess< / a > < / span >
< / dd >
< / dl >
< h4 class = "name" id = "instances_by_group" > < span class = "type-signature" > < / span > instances_by_group< span class = "signature" > (group_name)< / span > < span class = "type-signature" > → {< a href = "Array.html" > Array< / a > .< string>}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line112" > line 112< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Returns an array containing all of the instances in a group.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group_name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The group to query.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
If the provided group does not exist
< / div >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > < a href = "Array.html" > Array< / a > .< string>< / span >
< / dd >
< / dl >
< h4 class = "name" id = "new_identites" > < span class = "type-signature" > (async) < / span > new_identites< span class = "signature" > ()< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line572" > line 572< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Gets new identities for all instances in the pool.
< / div >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Resolves when all instances have new identities.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "new_identites_by_group" > < span class = "type-signature" > (async) < / span > new_identites_by_group< span class = "signature" > (group)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line583" > line 583< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Gets new identities for all instances in a group.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the group.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Resolves when all instances in the group have new identities.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "new_identity_at" > < span class = "type-signature" > (async) < / span > new_identity_at< span class = "signature" > (index)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line594" > line 594< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Gets a new identity for the instance at the provided index in the pool.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > index< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > Index of the instance in the pool.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Resolves when the instance has a new identity.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "new_identity_by_name" > < span class = "type-signature" > (async) < / span > new_identity_by_name< span class = "signature" > (name)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line607" > line 607< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Gets a new identity for the instance whose TorProcess.instance_name matches the provided name.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the instance.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
When no instance matched the provided name.
< / div >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Resolves when the instance has a new identity.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "next" > < span class = "type-signature" > < / span > next< span class = "signature" > ()< / span > < span class = "type-signature" > → {< a href = "TorProcess.html" > TorProcess< / a > }< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line536" > line 536< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Runs the load balance function (< a href = "TorPool.html#load_balance_method" > TorPool#load_balance_method< / a > ) on the array of instances in the pool and returns the first instance in the array.
< / div >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- The first instance in the modified array.
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > < a href = "TorProcess.html" > TorProcess< / a > < / span >
< / dd >
< / dl >
< h4 class = "name" id = "next_by_group" > < span class = "type-signature" > < / span > next_by_group< span class = "signature" > (group)< / span > < span class = "type-signature" > → {< a href = "TorProcess.html" > TorProcess< / a > }< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line549" > line 549< / a >
< / li > < / ul > < / dd >
< dt class = "tag-todo" > To Do:< / dt >
< dd class = "tag-todo" >
< ul >
< li > Load balance methods other than "round_robin" to be used< / li >
< / ul >
< / dd >
< / dl >
< div class = "description" >
Rotates the array containing instances in the group provided so that the second element becomes the first element and the first element becomes the last element.
[1,2,3] -> [2,3,1]
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the group< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- The first element in the modified array
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > < a href = "TorProcess.html" > TorProcess< / a > < / span >
< / dd >
< / dl >
< h4 class = "name" id = "remove" > < span class = "type-signature" > (async) < / span > remove< span class = "signature" > (instances, start_at< span class = "signature-attributes" > opt< / span > )< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line495" > line 495< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Removes a number of instances from the pool and kills their Tor processes.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Attributes< / th >
< th > Default< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > instances< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "default" >
< / td >
< td class = "description last" > Number of instances to remove< / td >
< / tr >
< tr >
< td class = "name" > < code > start_at< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "default" >
< code > 0< / code >
< / td >
< td class = "description last" > Index to start removing from< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Promise will resolve when the processes are dead
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "remove_at" > < span class = "type-signature" > (async) < / span > remove_at< span class = "signature" > (instance_index)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line507" > line 507< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Removes an instance at the provided index and kills its Tor process.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > instance_index< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > Index of the instance to remove< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Promise will resolve when the process is dead
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "remove_by_name" > < span class = "type-signature" > (async) < / span > remove_by_name< span class = "signature" > (instance_name)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line523" > line 523< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Removes an instance whose < a href = "TorProcess.html#instance_name" > TorProcess#instance_name< / a > property matches the provided name and kills its Tor process.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > instance_name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the instance to remove< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< div class = "param-desc" >
- Promise will resolve when the process is dead
< / div >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "remove_instance_from_group" > < span class = "type-signature" > < / span > remove_instance_from_group< span class = "signature" > (group, instance)< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line174" > line 174< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Removes an instance from a group.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The group to remove the instance from.< / td >
< / tr >
< tr >
< td class = "name" > < code > instance< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "TorProcess.html" > TorProcess< / a > < / span >
< / td >
< td class = "description last" > The instance in question.< / td >
< / tr >
< / tbody >
< / table >
< h4 class = "name" id = "remove_instance_from_group_at" > < span class = "type-signature" > < / span > remove_instance_from_group_at< span class = "signature" > (group, instance_index)< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line202" > line 202< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Removes an instance from a group by the index of the instance in the pool.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The group to remove the instance from.< / td >
< / tr >
< tr >
< td class = "name" > < code > instance_index< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > The index of the instance in question.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
If an instance with the index provided does not exist.
< / div >
< h4 class = "name" id = "remove_instance_from_group_by_name" > < span class = "type-signature" > < / span > remove_instance_from_group_by_name< span class = "signature" > (group, instance_name)< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line186" > line 186< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Removes an instance from a group by the < a href = "TorProcess.html#instance_name" > TorProcess#instance_name< / a > property on the instance.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The group to remove the instance from.< / td >
< / tr >
< tr >
< td class = "name" > < code > instance_name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The name of the instance in question.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
If an instance with the name provided does not exist.
< / div >
< h4 class = "name" id = "set_config_all" > < span class = "type-signature" > (async) < / span > set_config_all< span class = "signature" > (keyword, value)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line713" > line 713< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Set a configuration value for all instances in the pool via the control protocol.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > keyword< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the configuration property.< / td >
< / tr >
< tr >
< td class = "name" > < code > value< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "description last" > Value to set the configuration property to.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "set_config_at" > < span class = "type-signature" > (async) < / span > set_config_at< span class = "signature" > (index, keyword, value)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line682" > line 682< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Set a configuration value for the instance at the index in the pool via the control protocol.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > index< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > Index of the instance in the pool.< / td >
< / tr >
< tr >
< td class = "name" > < code > keyword< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the configuration property.< / td >
< / tr >
< tr >
< td class = "name" > < code > value< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "description last" > Value to set the configuration property to.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
When no instance exists at the provided index.
< / div >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "set_config_by_group" > < span class = "type-signature" > (async) < / span > set_config_by_group< span class = "signature" > (group, keyword, value)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line700" > line 700< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Set a configuration value for all instances in the provided group via the control protocol.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the group.< / td >
< / tr >
< tr >
< td class = "name" > < code > keyword< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the configuration property.< / td >
< / tr >
< tr >
< td class = "name" > < code > value< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "description last" > Value to set the configuration property to.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
When the provided group does not exist.
< / div >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "set_config_by_name" > < span class = "type-signature" > (async) < / span > set_config_by_name< span class = "signature" > (name, keyword, value)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line645" > line 645< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Set a configuration value for the instance whose TorProcess.instance_name matches the provided name via the control protocol.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the instance.< / td >
< / tr >
< tr >
< td class = "name" > < code > keyword< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the configuration property.< / td >
< / tr >
< tr >
< td class = "name" > < code > value< / code > < / td >
< td class = "type" >
< span class = "param-type" > any< / span >
< / td >
< td class = "description last" > Value to set the configuration property to.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
When no instance matched the provided name.
< / div >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "signal_all" > < span class = "type-signature" > (async) < / span > signal_all< span class = "signature" > (signal)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line725" > line 725< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Send a signal via the control protocol to all instances in the pool.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > signal< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The signal to send.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "signal_at" > < span class = "type-signature" > (async) < / span > signal_at< span class = "signature" > (index, signal)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line755" > line 755< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Send a signal via the control protocol to an instance at the provided index in the pool.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > index< / code > < / td >
< td class = "type" >
< span class = "param-type" > number< / span >
< / td >
< td class = "description last" > Index of the instance in the pool.< / td >
< / tr >
< tr >
< td class = "name" > < code > signal< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The signal to send.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "signal_by_group" > < span class = "type-signature" > (async) < / span > signal_by_group< span class = "signature" > (group, signal)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line773" > line 773< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Send a signal via the control protocol to all instances in the provided group.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > group< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the group.< / td >
< / tr >
< tr >
< td class = "name" > < code > signal< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The signal to send.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Throws:< / h5 >
< div class = "param-desc" >
When the provided group does not exist.
< / div >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h4 class = "name" id = "signal_by_name" > < span class = "type-signature" > (async) < / span > signal_by_name< span class = "signature" > (name, signal)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line738" > line 738< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Send a signal via the control protocol to an instance whose < a href = "TorProcess.html#instance_name" > TorProcess#instance_name< / a > property matches the provided name.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > name< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > Name of the instance.< / td >
< / tr >
< tr >
< td class = "name" > < code > signal< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > The signal to send.< / td >
< / tr >
< / tbody >
< / table >
< h5 > Returns:< / h5 >
< dl class = "param-type" >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
< h3 class = "subsection-title" > Events< / h3 >
< h4 class = "name" id = "event:instance_created" > instance_created< / h4 >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "TorPool.js.html" > TorPool.js< / a > , < a href = "TorPool.js.html#line422" > line 422< / a >
< / li > < / ul > < / dd >
< / dl >
< div class = "description" >
Fires when an instance has been created.
< / div >
< h5 > Type:< / h5 >
< ul >
< li >
< span class = "param-type" > < a href = "TorProcess.html" > TorProcess< / a > < / span >
< / li >
< / ul >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > instance< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "TorProcess.html" > TorProcess< / a > < / span >
< / td >
< td class = "description last" > The instance that was created.< / td >
< / tr >
< / tbody >
< / table >
< / article >
< / section >
< / div >
< br class = "clear" >
< footer >
2018-09-25 16:53:29 +00:00
Documentation generated by < a href = "https://github.com/jsdoc3/jsdoc" > JSDoc 3.5.5< / a > on Tue Sep 25 2018 12:53:23 GMT-0400 (Eastern Daylight Time) using the < a href = "https://github.com/clenemt/docdash" > docdash< / a > theme.
2018-09-19 15:22:17 +00:00
< / footer >
< script > prettyPrint ( ) ; < / script >
< script src = "scripts/linenumber.js" > < / script >
< / body >
< / html >