# oox

**OOX** - slave isolated process & scheduler for jun environments

[![Build Status](](
[![License: MIT](](

OOX is a set of tools to execute many jun commands into an isolated slave process, taking control of the cluster (slaves) and managing
the connection to it. This tools also can be used to generate a job and check if passed or broken (similar to TDD) but applied to
jun commands and taking advantage of the slave to run all process on a separated node.

This project is under development and should not be used in production, it's not ready for that.

## Prerequisites

In order to execute the system correctly, just start the environment in a valid node (short & long names are allowed)

$ erl -pa _build/default/lib/*/ebin/ -name oox@ -setcookie oox

After executing this all dependencies are set in path, just start them:

(oox@> Apps = [syntax_tools, compiler, goldrush, lager, erlport, jun, oox].
(oox@> lists:foreach(fun(App) -> application:start(App) end, Apps).
18:07:20.845 [info] Application lager started on node 'oox@'
18:07:20.846 [info] Application erlport started on node 'oox@'
18:07:20.848 [info] Application jun started on node 'oox@'
18:07:20.850 [info] Application oox started on node 'oox@'

Don't worry about starting the apps in the environment if you use `oox` for example in a rebar.config,
this is only to show how the system works.

## Add a subscriber process

Since jobs can be executed in async mode, the response will be delivered to a process, just set it:

(oox@> oox_scheduler:set_subscriber(self()).

## Creating a new job

Now creates a new job, this will start a new slave on the host, ready to execute jun commands, it means that
slave contains an isolated jun environment, adding a job is easy:

(oox@> {ok, Job} = oox_scheduler:add_job("").
11:40:12.308 [info] ensuring started for jun main dependency, state ok
11:40:13.314 [info] reached slave node '1536856812309129@', sending launch signal to main process <0.118.0>
11:40:13.314 [info] receiving launch signal for slave '1536856812309129@'
11:40:13.689 [info] sent RPC to slave node '1536856812309129@' with response {ok,<11388.64.0>}
11:40:13.689 [info] starting jun worker on slave node at <11388.64.0>

## Using commands

Define some commands in order to send & execute into slave via scheduler, the commands can be a specific overriden variables,
for example if in the command you want to use the worker, just use $worker in the args. Example:


## Starting the job

Start the job to process the commands in the slave and waiting for response (remember response is delivered to the subscriber),
when job finish also the slave is stopped.

(oox@> oox_scheduler:start_job(Job, Cmds).

## Receive response of job

In the subscriber process you will receive a response based on the execution of commands, there is two posibles responses: passed or broken.

(oox@> flush().
Shell got {job,<0.115.0>,{broken,{error,{'exceptions.KeyError',"Atom('fage')"}}}}
### See also

[JUN: python pandas support for dataframes manipulation over erlang](

#### Authors

@zgbjgg Jorge Garrido <>