class innerbbop-rest-manager~ manager_node
Source: manager.
new manager_node(response_handler)
Contructor for the REST query manager; NodeJS-style.
This is an asynchronous engine, so while both fetch and start will run the callbacks, fetch will return null while start returns a promise for the eventual result. Using the promise is entirely optional--the main method is still considered to be the callbacks.
NodeJS BBOP manager for dealing with remote calls. Remember, this is actually a "subclass" of
See also: {module:bbop-rest-manager#manager}
Parameter
Name | Type | Optional | Description |
---|---|---|---|
response_handler |
Object |
|
- Returns
-
manager_node
Methods
fetch([url][, payload], method) → null
It should combine the URL, payload, and method in the ways appropriate to the subclass engine.
Runs callbacks, returns null.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
url |
String |
Yes |
update resource target with string |
payload |
Object |
Yes |
object to represent arguments |
method |
String |
|
GET, POST, etc. |
- Returns
-
null
returns null
start([url][, payload], method) → Object
It should combine the URL, payload, and method in the ways appropriate to the subclass engine.
What we're aiming for is a system that:
- runs callbacks (in order: success, error, return)
- return promise (delivering response)
Parameters
Name | Type | Optional | Description |
---|---|---|---|
url |
String |
Yes |
update resource target with string |
payload |
Object |
Yes |
object to represent arguments |
method |
String |
|
GET, POST, etc. |
- Returns
-
Object
promise for the processed response subclass