new PromiseServer()
        Constructor for a Jayson Promise Server
    
    
    
    
    
    
    
- Source:
 - See:
 
Returns:
- Type
 - PromiseServer
 
Extends
Methods
- 
    
_resolveRouter(method, params)
 - 
    
    Invoke the router
Parameters:
Name Type Description methodString Method to resolve paramsArray | Object Request params - Inherited From:
 - Source:
 
Returns:
- Type
 - Method
 
 - 
    
call(request [, context] [, originalCallback])
 - 
    
    Calls a method on the server
Parameters:
Name Type Argument Description requestObject | Array | String A JSON-RPC request object. Object for single request, Array for batches and String for automatic parsing (using the reviver option) contextObject <optional> 
Optional context object passed to methods originalCallbackfunction <optional> 
Callback that receives one of two arguments: first is an error and the second a response - Inherited From:
 - Source:
 
 - 
    
error( [code] [, message] [, data])
 - 
    
    Returns a JSON-RPC compatible error property
Parameters:
Name Type Argument Default Description codeNumber <optional> 
-32603 Error code messageString <optional> 
"Internal error" Error message dataObject <optional> 
Additional data that should be provided - Inherited From:
 - Source:
 
Returns:
- Type
 - Object
 
 - 
    
getMethod(name)
 - 
    
    Gets a method from the server
Parameters:
Name Type Description nameString - Inherited From:
 - Source:
 
Returns:
- Type
 - Method
 
 - 
    
hasMethod(name)
 - 
    
    Checks if a method is registered with the server
Parameters:
Name Type Description nameString Name of method - Inherited From:
 - Source:
 
Returns:
- Type
 - Boolean
 
 - 
    
method(name, definition)
 - 
    
    Adds a single method to the server
Parameters:
Name Type Description nameString Name of method to add definitionfunction | Client Function or Client for a relayed method - Inherited From:
 - Source:
 
Throws:
- 
        Invalid parameters
 - Type
 - TypeError
 
 - 
    
methods(methods)
 - 
    
    Adds a batch of methods to the server
Parameters:
Name Type Description methodsObject Methods to add - Inherited From:
 - Source:
 
 - 
    
removeMethod(name)
 - 
    
    Removes a method from the server
Parameters:
Name Type Description nameString - Inherited From:
 - Source: