PolledExternalService
An external HTTP service that is kept up-to-date by polling.
A PolledExternalService may be composed of one or more PolledHTTPResources, each of which describes a single endpoint and how to poll it.
Implements
- ExternalService
Constructors
new PolledExternalService()
new PolledExternalService(resources): PolledExternalService
Construct a polled external service.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| resources | {} | Specification(s) of external resource(s) to poll | 
Returns
Methods
shutdown()
shutdown(): Promise<void>
Shutdown the external service.
Returns
Promise<void>
Implementation of
ExternalService.shutdown
subscribe()
subscribe(
   instance, 
   resourceName, 
   params, 
   callbacks): Promise<void>
Subscribe to a resource provided by the external service.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| instance | string | Instance identifier of the external resource. | 
| resourceName | string | - | 
| params | Json | Parameters of the external resource. | 
| callbacks | { error: (error) =>void;update: (updates,isInit) =>Promise<void>; } | Callbacks to react on error/update. | 
| callbacks.error | ( error) =>void | Error callback to log the error that prevent an idermetiate update. | 
| callbacks.update | ( updates,isInit) =>Promise<void> | Update callback. | 
Returns
Promise<void>
Implementation of
ExternalService.subscribe
unsubscribe()
unsubscribe(instance): void
Unsubscribe from a resource provided by the external service.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| instance | string | Instance identifier of the external resource. | 
Returns
void
Implementation of
ExternalService.unsubscribe