Web Service Multithread Worker

The Web Service Multithread Worker is designed to be used with the Web Service Multithread component. For steps on setting up and running the two components, see the documentation for the Web Service Multithread component.

The worker component handles the actual processing of the data dispatched by the ServerComponent. The component’s custom fields contain a ThreadCount value used to create multiple worker component threads running in parallel to process several requests simultaneously.

Adapting the Component:

There are a few ways you can adapt and expand this component for more complex workflows:

On startup, the component spins up the configured number of ThreadCount to handle inbound requests. Depending on the volume expected, you can set the ThreadCount to any number between 2 and 100.

Inbound requests are sent from the Web Service Multithread component as JSON strings. Requests are parsed and at this point, any data processing can be implemented.

A general response is constructed and sent back to the web service. If adapted, the response must contain three pieces of information:

  • You must first use WEBsetResponseHeaders to set the required response headers as they contain connection information for which request to respond to.

  • You can include any additional headers required.

  • You can customize the response body.

Once constructed, component.call is used to call the WEBrespond function in the Web Server component with the response data so it can respond to the source connection.

 

Related pages