Reference Source
public class | source

RoutesSvcConsumer

Extends:

devapt-core-common/dist/js/services/service_consumer~ServiceConsumer → RoutesSvcConsumer

Routes service consumer class for middleware routes.

Constructor Summary

Public Constructor
public

constructor(arg_consumer_name: string, arg_service_instance: Service, arg_context: string): nothing

Create a service consumer for routes.

Method Summary

Public Methods
public

consume_local(arg_provider: object, arg_routes: array): object

Consume a service on the same host.

public

consume_remote(arg_provider: object, arg_routes: array): Promise

Consume a service on a remote host.

public

prepare_args(arg_operands: *): array

Enhance operands if needed

Public Constructors

public constructor(arg_consumer_name: string, arg_service_instance: Service, arg_context: string): nothing source

Create a service consumer for routes.

Params:

NameTypeAttributeDescription
arg_consumer_name string

consumer name

arg_service_instance Service

service instance

arg_context string

logging context label

Return:

nothing

Public Methods

public consume_local(arg_provider: object, arg_routes: array): object source

Consume a service on the same host.

Params:

NameTypeAttributeDescription
arg_provider object

service provider

arg_routes array

Routes to request

Return:

object

a promise of results

public consume_remote(arg_provider: object, arg_routes: array): Promise source

Consume a service on a remote host.

Params:

NameTypeAttributeDescription
arg_provider object

service provider

arg_routes array

Routes to request

Return:

Promise

Promise of ServiceResponse instance.

public prepare_args(arg_operands: *): array source

Enhance operands if needed

Params:

NameTypeAttributeDescription
arg_operands *

Return:

array

array of routes to consume