Skip to main content
Namespace: Ans.DataProcessing.operators.server

Summary

Starts a dpf’s grpc server (if local) or connect to one and keep it waiting for requests in a streams. available inputs: ip (string) (optional), port (string, Int32) (optional), starting_option (Int32) (optional), should_start_server (bool) (optional), data_sources (DataSources) (optional), dpf_context (string, Int32) (optional) available outputs: grpc_streams (StreamsContainer)

Example

Class Information

Inputs

ip

If no ip address is put, the local ip address is taken Type: LinkableInput

port

If no port is put, port 50052 is taken Type: LinkableInput

starting_option

default is 1 that starts server in new thread. With 0, this thread will be waiting for grpc calls and will not be usable for anything else. With 2, it the server will be started in a new process. Type: LinkableInput

should_start_server

If true, the server is assumed to be local and is started. If false, only a client (able to send grpc calls) will be started Type: LinkableInput

data_sources

A data source with result key ‘grpc’ and file path ‘port:ip’ can be used instead of the input port and IP. Type: LinkableInput

dpf_context

This pin is associated with pin(2) = 2 (server started in a new process). User can enter the integer associated with a DPF context (1: Standalone Context - DpfCoreStandalone.xml, 3: Custom - DpfCustomDefined.xml) or a string with the path of the XML specifying the context. Type: LinkableInput

Outputs

grpc_streams

dpf streams handling the server, if the server is started in this thread, then nothing is added in output Type: LinkableOutput

Constructors

Constructor

Constructor

Parameters:
  • ip (object)
  • port (object)
  • starting_option (object)
  • should_start_server (object)
  • data_sources (object)
  • dpf_context (object)
  • config (OperatorConfig)

Constructor

Parameters:
  • config (OperatorConfig)

Methods

Properties

inputs

Type: InputSpec

outputs

Type: OutputSpec

defaultConfig

Type: Config