Skip to content

Instantly share code, notes, and snippets.

View idabmat's full-sized avatar
:shipit:
Out there

Igor de Alcantara Barroso idabmat

:shipit:
Out there
View GitHub Profile
@idabmat
idabmat / dpg
Created August 13, 2023 17:08
dockerized PG
#!/bin/env ruby
require "thor"
require "json"
class PG < Thor
package_name "Dockerized PG"
include Thor::Actions
class SequentialWorkflow < Zenaton::Interfaces::Workflow
include Zenaton::Traits::Zenatonable
def handle
a = TaskA.new.execute # Let's store the return value from the task
if a > 0 # And use that value to determine which task to run next
TaskB.new.execute
else
TaskC.new.execute
class TaskA < Zenaton::Interfaces::Task
include Zenaton::Traits::Zenatonable
def handle
puts 'Task A starts'
sleep 3 # Task takes some time to complete
puts 'Task A ends'
0 # The result of the task
end
@idabmat
idabmat / launch_workflow.rb
Last active August 15, 2018 08:58
Zenaton Ruby
require 'zenaton'
Zenaton::Client.init(
app_id, # You application ID
api_token, # Your API token
app_env # production, staging, development, or whatever you want
)
SequentialWorkflow.new.dispatch
public class Employee {
public Money calculatePay();
public void save();
public String reportHours();
}

Keybase proof

I hereby claim:

  • I am idabmat on github.
  • I am idabmat (https://keybase.io/idabmat) on keybase.
  • I have a public key ASC07dnb_2HMEgfBSR2qXrcRQWoRwxOaxm8XCKlmw7k7Ago

To claim this, I am signing this object: