Object built-in object

Object HttpRepeater

http Request forwarding processor

http Used to http The request forwarding to the back-end server is used as follows:

1 2
var http = require('http'); var hr = new http.Repeater('http://10.0.0.100:8080/test');

Inheritance

#lineWidth: 1.5 #font: Helvetica,sans-Serif #fontSize: 10 #leading: 1.6 #.this: fill=lightgray #.class: fill=white [<class>object|toString();toJSON()] [<class>Handler|new Handler()|invoke()] [<this>HttpRepeater|new HttpRepeater()|urls;client|load()] [object] <:- [Handler] [Handler] <:- [HttpRepeater] HttpRepeater new HttpRepeater() urls client load() Handler new Handler() invoke() object toString() toJSON()

Constructor

HttpRepeater

HttpRepeater constructor to create a new HttpRepeater object

1
new HttpRepeater(String url);

Call parameters:

  • url: String, specify a backend server url

HttpRepeater constructor to create a new HttpRepeater object

1
new HttpRepeater(Array urls);

Call parameters:

  • urls: Array, specify a group of back-end servers url

Member attributes

urls

NArray, query the current back-end server url List

1
readonly NArray HttpRepeater.urls;

client

HttpClient, Used internally by the request forwarding processor HttpClient Object

1
readonly HttpClient HttpRepeater.client;

Member function

load

Load a new set of backends url

1
HttpRepeater.load(Array urls);

Call parameters:

  • urls: Array, specify a group of back-end servers url

invoke

Process a message or object

1
Handler HttpRepeater.invoke(object v) async;

Call parameters:

  • v: object, Specify the message or object to be processed

Return result:

  • Handler, Return to the next processor

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics

1
String HttpRepeater.toString();

Return result:

  • String, Returns the string representation of the object

toJSON

Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object

1
Value HttpRepeater.toJSON(String key = "");

Call parameters:

  • key: String, unused

Return result:

  • Value, Returns a value containing JSON serializable