All Projects → zenaton → zenaton-ruby

zenaton / zenaton-ruby

Licence: MIT License
💎 Ruby gem to run and orchestrate background jobs with Zenaton Workflow Engine

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to zenaton-ruby

zenaton-node
⚡ Node.js library to run and orchestrate background jobs with Zenaton Workflow Engine
Stars: ✭ 50 (+56.25%)
Mutual labels:  workflow-engine, orchestration, queues, job-orchestration, queuing-system
Prefect
The easiest way to automate your data
Stars: ✭ 7,956 (+24762.5%)
Mutual labels:  workflow, workflow-engine, orchestration
Server
The Prefect API and backend
Stars: ✭ 87 (+171.88%)
Mutual labels:  workflow, workflow-engine, orchestration
Etl unicorn
数据可视化, 数据挖掘, 数据处理 ETL
Stars: ✭ 156 (+387.5%)
Mutual labels:  workflow, workflow-engine
Microflow
Lightweight workflow engine
Stars: ✭ 129 (+303.13%)
Mutual labels:  workflow, workflow-engine
Zeebe
Distributed Workflow Engine for Microservices Orchestration
Stars: ✭ 2,165 (+6665.63%)
Mutual labels:  workflow, workflow-engine
Petrinet
🚥 Petrinet framework for PHP
Stars: ✭ 107 (+234.38%)
Mutual labels:  workflow, workflow-engine
Viewflow
Reusable workflow library for Django
Stars: ✭ 2,136 (+6575%)
Mutual labels:  workflow, workflow-engine
Batchflow
BatchFlow helps you conveniently work with random or sequential batches of your data and define data processing and machine learning workflows even for datasets that do not fit into memory.
Stars: ✭ 156 (+387.5%)
Mutual labels:  workflow, workflow-engine
Cuneiform
Cuneiform distributed programming language
Stars: ✭ 175 (+446.88%)
Mutual labels:  workflow, workflow-engine
Pallets
Simple and reliable workflow engine, written in Ruby
Stars: ✭ 216 (+575%)
Mutual labels:  workflow, workflow-engine
Microwf
A simple finite state machine (FSM) with workflow character where you define your workflows in code.
Stars: ✭ 122 (+281.25%)
Mutual labels:  workflow, workflow-engine
Openmole
Workflow engine for exploration of simulation models using high throughput computing
Stars: ✭ 120 (+275%)
Mutual labels:  workflow, workflow-engine
Django Lb Workflow
Reusable workflow library for Django
Stars: ✭ 153 (+378.13%)
Mutual labels:  workflow, workflow-engine
Pyflow
A lightweight parallel task engine
Stars: ✭ 108 (+237.5%)
Mutual labels:  workflow, workflow-engine
Workflow core
[Deprecated, use flor_core instead] A Rails engine which providing essential infrastructure of workflow. It's based on Workflow Nets.
Stars: ✭ 171 (+434.38%)
Mutual labels:  workflow, workflow-engine
Flor
a workflow engine
Stars: ✭ 190 (+493.75%)
Mutual labels:  workflow, workflow-engine
Aiida Core
The official repository for the AiiDA code
Stars: ✭ 238 (+643.75%)
Mutual labels:  workflow, workflow-engine
Nflow
nFlow is a battle-proven solution for orchestrating business processes. It can be used as microservices orchestrator (Saga-pattern), as business process engine or as persistent finite-state machine.
Stars: ✭ 96 (+200%)
Mutual labels:  workflow, workflow-engine
Cadence Python
Python framework for Cadence Workflow Service
Stars: ✭ 100 (+212.5%)
Mutual labels:  workflow, orchestration

⚠️ This repository is abandoned.


Easy Asynchronous Jobs Manager for Developers
Explore the docs »
Website · Examples in Ruby · Tutorial in Ruby

Gem Version CircleCI License

Table of contents

Getting Started

Requirements

This gem has been tested with Ruby 2.3 and later.

Installation

Add this line to your application's Gemfile:

gem 'zenaton'

And then execute:

$ bundle

Or install it yourself as:

$ gem install zenaton

Setup with Ruby on Rails

Client initialization

  1. Create an initializer in config/initializers/zenaton.rb with the following:
Zenaton::Client.init(
  ENV['ZENATON_APP_ID'],
  ENV['ZENATON_API_TOKEN'],
  ENV['ZENATON_APP_ENV']
)
  1. Add a .env file at the root of your project with your credentials:
ZENATON_API_URL=...
ZENATON_APP_ID=...
ZENATON_API_TOKEN=...

Don't forget to add it to your .gitignore:

$ echo ".env" >> .gitignore
  1. Add the dotenv gem to your Gemfile to easily load these variables in development:
gem 'dotenv-rails', groups: [:development, :test]

Worker Installation

Your workflow's tasks will be executed on your worker servers. Please install a Zenaton worker on it:

$ curl https://install.zenaton.com | sh

that you can start and configure from your application directory with

$ zenaton start && zenaton listen --env=.env --rails

where .env is the env file containing your credentials.

Note In this example we created our workflows and tasks in the /app folder since Rails will autoload ruby files in that path. If you create your workflows and tasks somewhere else, ensure Rails loads them at boot time.

Your are now ready to write tasks and workflows !

Setup with plain Ruby

Client Initialization

You will need to export three environment variables: ZENATON_APP_ID, ZENATON_API_TOKEN, ZENATON_APP_ENV. You'll find them here.

Then you can initialize your Zenaton client:

require 'dotenv/load'
require 'zenaton'

Zenaton::Client.init(
  ENV['ZENATON_APP_ID'],
  ENV['ZENATON_API_TOKEN'],
  ENV['ZENATON_APP_ENV']
)

Worker Installation

Your workflow's tasks will be executed on your worker servers. Please install a Zenaton worker on it:

$ curl https://install.zenaton.com | sh

that you can start and configure with

$ zenaton start && zenaton listen --env=.env --boot=boot.rb

where .env is the env file containing your credentials, and boot.rb is a file that will be included before each task execution - this file should load all workflow classes.

Usage

For more detailed examples, please check Zenaton Ruby examples.

Writing a task

class MyTask < Zenaton::Interfaces::Task
  include Zenaton::Traits::Zenatonable

  def handle
    # Your task implementation
  end
end

Check the documentation for more details.

Writing a workflow

class MyWorkflow < Zenaton::Interfaces::Workflow
  include Zenaton::Traits::Zenatonable

  def handle
    # Your workflow implementation
  end
end

Note that your workflow implementation should be idempotent.

With Ruby on Rails, you may need to run $ spring stop to force Spring to load your app fresh.

Check the documentation for more details.

Lauching a workflow

We can start a workflow from anywhere in our application code with:

MyWorkflow.new.dispatch

Documentation

Please see https://zenaton.com/documentation/ruby/getting-started for complete documentation.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/zenaton/zenaton-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the zenaton-ruby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].