List of service descriptions configured for the dispatcher factory.
Adds a service.
The constructor for the service.
The name of the service. If not specified the name of the constructor is used.
Creates a request dispatcher used for dispatching service requests.
Generated using TypeDoc
The DispatcherFactory is the primary class used to configure the service model, and is responsible for creating the RequestDispatcher based on the service descriptions.
Example
Once our service is defined, we add it to a DispatcherFactory. We then add an endpoint to the service, providing the name of the contract, the base address for the endpoint, and a list of endpoint behaviors.
import { DispatcherFactory, RpcBehavior } from "service-model"; var factory = new DispatcherFactory(); factory.addService(CalculatorService) .addEndpoint("Calculator", "/api/calculator", [new RpcBehavior()]);
In this case, we add the RpcBehavior which indicates that operations on this endpoint will be available through RPC.