Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Latest commit

 

History

History
30 lines (20 loc) · 832 Bytes

multilang.rst

File metadata and controls

30 lines (20 loc) · 832 Bytes

Using Emit in Other Languages

You can use Emit in other languages through the multilang API.

Defining Tasks

We're going to define a node that takes a number and emits each integer in that range. Let's do it with Ruby! (why not?)

../examples/multilang/test.rb

(the equivalent in Python is in examples/multilang/test.py)

The messages passed in and out are expected to be in JSON format. Output from the functions should be json strings separated by newlines.

Creating a Node

We'll be subclassing :pyemit.multilang.ShellNode to tell emit how to execute our task:

../examples/multilang/graph.py

After that, you can call your node and subscribe as normal.