Tenant Functions
  • 13 Jul 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Tenant Functions

  • Dark
    Light
  • PDF

Article summary

While the System Functions provide a substantial amount of functionality for your Tenant's processing network, in many cases you may want to augment those Functions with ones that are specific to your processing needs.

For example:

  • You want to augment a message with information from a database as you are processing that message.
  • You need to call an API with information included in the message during part of your processing.
  • You have a Tenant Message Type that you want to convert the message to or convert the message from.
  • You have an incoming Webhook that requires custom authentication

EchoStream allows you to create as many Tenant-specific Functions as you wish to fulfill these types of use-cases.

Creating

To create a Tenant-specific Function, you must provide the following:

Name

The name of your Function must conform to the regular expression ^[A-Za-z0-9_.:/=+-@ ]{3,80}$ and must be unique within your Tenant.

Code

The actual Python code of the Function. Just like custom functions in your Nodes, all Python code in your Function must be contained within a single top-level def declaration.

The signature of the Function's def declaration is dependant on the Function's type.

Argument Message Type

All Bitmapper and Processor Functions have an Argument Message Type. This is the type of message that will be passed to the function for processing.

Note - this cannot be changed after Function creation.

Return Message Type

Functions that return messages (i.e. - Processor Functions) will have a Return Message Type. This is the type of message that will be returned by the Functions after processing.

Note - this cannot be changed after Function creation.

Requirements

If your Function requires third-party Python packages, you may provide a list of those packages in pip requirement specifiers format.

For example, if your Function does image conversion you could include Pillow by:

Pillow

README

While is is not required, EchoStream strongly suggests that you provide a README in Markdown format that provides a more in-depth explanation of your Function and it's use to users of your Function.

Updating

You may update the code, requirements, description and readme of your Function. Updates are automatically applied to all Nodes that use your Function (unaltered) in near-real time.

Deleting

You may delete your Function if there are no Nodes in your Tenant that use it.


What's Next