Last active
April 19, 2019 08:48
-
-
Save alexxty7/0e09aa870e586d8785788d628746e7dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Macro::Queue(Api::V1::Clients::Bookings::Operation::CreateChat, args: [:booking]) | |
| module Macro | |
| def self.Queue(constant, args:) | |
| task = lambda { |(ctx, flow_options), **| | |
| StepWorker.perform_async(constant, ctx.slice(*args)) | |
| [Trailblazer::Activity::Left, [ctx, flow_options]] | |
| } | |
| { task: task, id: constant.class_name } | |
| end | |
| class StepWorker | |
| include Sidekiq::Worker | |
| def perform(constant, args) | |
| constant.call(args) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment