Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Build and run event-driven processes within the product journey in days instead of months.
ie. payment, booking, personalized communication sequences, ETL processes and more.
Now with 90+ APIs connectors.
Explore the docs »
Website
·
Examples in Node
·
Tutorial in Node
Zenaton helps developers to easily run, monitor and orchestrate background jobs on your workers without managing a queuing system.
Build workflows using Zenaton functions to build control flows around your business logic and tasks - managing time, events and external services within one class. The Zenaton engine orchestrates the timing of executions on your workers. Functions include 'wait for a specific time or event', 'react to external events', 'run parallel tasks, 'create schedules' and more all by writing one line of code. More about Zenaton Functions
Key capabilities:
Single Tasks - dispatch or schedule an asynchronous business job with just one line of code.
Workflows as code - Combine Zenaton functions and Node.js to create infinite possibilities of logic.
Real-time Monitoring - Get a real-time view of workers and tasks - scheduled, processing and executed.
Scheduler - Schedule recurrent tasks and workflows and automatically retry tasks that fail or get alerts when there are errors or timeouts.
Error Handling: - Alerts for errors and timeouts and retry, resume or kill processes. React to errors by writing logic into workflow code to trigger retries or other actions.
You can sign up for an account on Zenaton and go through the tutorial in Node.
You can find all details on Zenaton's website.
Node 8 and later.
To install the Zenaton agent, run the following command:
curl https://install.zenaton.com/ | sh
To add the latest version of the library to your project, run the following command:
npm install zenaton --save
For Typescript developers:
npm install @types/zenaton --save-dev
To start, you need to initialize the client. To do this, you need your Application ID and API Token. You can find both on your Zenaton account.
Then, initialize your Zenaton client:
/* client.js */
const { Client } = require("zenaton");
module.exports = new Client(
"YourApplicationId",
"YourApiToken",
"YourApplicationEnv", // Use "dev" as default
);
The next step is to have your Zenaton Agent listen to your application.
The Agent needs to be pointed to a boot
file which will allow it to infer your programming language (here JavaScript) but also to figure out where your jobs are located when the time comes to run them.
/* boot.js */
const { task, workflow } = require("zenaton");
// Import here all your tasks and workflows as you go
// task("HelloWorldTask", require("./tasks/HelloWorldTask"));
// workflow("MyFirstWorkflow", require("./workflows/MyFirstWorkflow"));
To run the listen
command:
zenaton listen --app_id=YourApplicationId --api_token=YourApiToken --app_env=YourApplicationEnv --boot=boot.js
A job in Zenaton is created through the task
function.
Let's start by implementing a first task printing something, and returning a value:
/* tasks/HelloWorldTask.js */
const { task } = require("zenaton");
module.exports.handle = async function(name = "World") {
return `Hello ${name}`!;
};
Now, when you want to run this task as a background job, you need to do the following:
/* launchHelloWorldTask.js */
const { run } = require("./client.js");
run.task("HelloWorldTask", "Me");
That's all you need to get started. With this, you can run many background jobs. However, the real power of Zenaton is to be able to orchestrate these jobs. The next section will introduce you to job orchestration.
Job orchestration is what allows you to write complex business workflows in a simple way. You can execute jobs sequentially, in parallel, conditionally based on the result of a previous job, and you can even use loops to repeat some tasks.
We wrote about some use-cases of job orchestration, you can take a look at these articles to see how people use job orchestration.
A workflow in Zenaton is created through the workflow
function.
We will implement a very simple workflow that will execute sequentially the HelloWorld
task 3 times.
One important thing to remember is that your workflow implementation must be idempotent. You can read more about that in our documentation.
The implementation looks like this:
/* workflows/MyFirstWorkflow.js */
module.exports.handle = function*(name) {
yield this.run.task("HelloWorldTask", name);
yield this.run.task("HelloWorldTask", "Me");
yield this.run.task("HelloWorldTask", "All");
};
Now that your workflow is implemented, you can ask for its processing like this:
/* launchMyFirstWorkflow.js */
const { run } = require("./client.js");
run.workflow("MyFirstWorkflow", "Gilles");
There are many more features usable in workflows in order to get the orchestration done right. You can learn more in our documentation.
Need help? Feel free to contact us by chat on Zenaton.
Found a bug? You can open a GitHub issue.
0.8.0 - 2020-01-20
LAST_CODE_PATH
to serverless
.serverless
code path.FAQs
Zenaton library
We found that zenaton demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.