Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Transformer Specification

The transformer is defined as an actor and cand be sync as well as async.

Code Block
languagejs
const transformer = {
    name: "transformer_name", 
    event_schemaeventGrammar: "es11", //EventGrammar on which the transformer can act.
    dataset_schemadatasetGrammar: "ds23", //Dataset that this transformer which modify.
    config: {
        spawn((callback, receive) => {

            // send to parent manage side effects here 
            // Examples - logging, pushing to an externa event bus, etc.
            callback('SOME_EVENT');

            // receive from parent
            receivetransform((event) => {
              // handle event
   transform event to dataset; Has access to event and dataset grammars for validation
            });

            // disposal
            return () => {
              /* do cleanup here */
              /* push this to dataset */
            };
        }),
    }
}

How this event is processed is defined by a pipe. A pipe connects then event to a source. Example of a pipe is as shown below

Code Block
languagejson
{
  "event": "es11",
  "transformer": "tr33",
  "dataset": "ds23"
}