Reference Source
public class | source

SocketIOServiceProvider

Extends:

devapt-core-common/dist/js/services/service_provider~ServiceProvider → SocketIOServiceProvider

Service provider base class with SocketIO provider features.

Constructor Summary

Public Constructor
public

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

Create a service provider.

Member Summary

Public Members
public
public

runtime: *

public

Method Summary

Public Methods
public

activate_on_socketio_server(arg_socketio: object): nothing

Activate service on one socketio server for browser request with messages.

public

Activate service on socketio server for browser request with messages.

public

Get service provider operations.

public

on_method(arg_method: string, arg_socket: object, arg_data: object, arg_credentials: Credentials): nothing

Get operation handler on socket.

public

Post a message on the bus.

public abstract

process(arg_method: string, arg_operands: array, arg_credentials: Credentials): Promise

Process request and returns datas.

public

subscribe(arg_socket: object, arg_data: object): nothing

Add a subscriber socket.

public

unsubscribe(arg_socket: object, arg_data: object): nothing

Remove a subscriber socket.

Public Constructors

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

Create a service provider.

Params:

NameTypeAttributeDescription
arg_provider_name string

consumer name.

arg_service_instance Service

service instance.

arg_context string

logging context label.

Return:

nothing

Public Members

public is_socketio_service_provider: boolean source

public runtime: * source

public subscribers_sockets: *[] source

Public Methods

public activate_on_socketio_server(arg_socketio: object): nothing source

Activate service on one socketio server for browser request with messages.

Params:

NameTypeAttributeDescription
arg_socketio object

socketio server.

Return:

nothing

public activate_on_socketio_servers(): nothing source

Activate service on socketio server for browser request with messages.

Return:

nothing

public get_io_operations(arg_socket: object): object source

Get service provider operations.

Params:

NameTypeAttributeDescription
arg_socket object

client socket.

Return:

object

plain object of operations as name:callback

public on_method(arg_method: string, arg_socket: object, arg_data: object, arg_credentials: Credentials): nothing source

Get operation handler on socket.

Params:

NameTypeAttributeDescription
arg_method string

method name

arg_socket object

subscribing socket.

arg_data object

query filter or datas (optional).

arg_credentials Credentials

request credentials

Return:

nothing

public post_provided_values_to_subscribers(arg_msg: object): nothing source

Post a message on the bus.

Params:

NameTypeAttributeDescription
arg_msg object

message payload.

Return:

nothing

public abstract process(arg_method: string, arg_operands: array, arg_credentials: Credentials): Promise source

Process request and returns datas.

Params:

NameTypeAttributeDescription
arg_method string

method name

arg_operands array

request operands

arg_credentials Credentials

request credentials

Return:

Promise

public subscribe(arg_socket: object, arg_data: object): nothing source

Add a subscriber socket.

Params:

NameTypeAttributeDescription
arg_socket object

subscribing socket.

arg_data object

subscribing filter or datas (optional).

Return:

nothing

public unsubscribe(arg_socket: object, arg_data: object): nothing source

Remove a subscriber socket.

Params:

NameTypeAttributeDescription
arg_socket object

subscribing socket.

arg_data object

subscribing filter or datas (optional).

Return:

nothing