Sha256: e7e4585d70419b486ac664a4f505080f126e0803333e8241f44f155d64decd56

Contents?: true

Size: 931 Bytes

Versions: 9

Compression:

Stored size: 931 Bytes

Contents

module Rasti
  class App
    class AsynchronicInteraction < Interaction

      def self.asynchronic?
        true
      end      

      private

      def job
        @job ||= Asynchronic[session.job_id].job
      end

      def enqueue(interaction, params)
        options, attributes = Utils.split_hash params, [:queue, :alias, :dependency, :dependencies]

        job.send :async, Job, queue:        options[:queue] || Asynchronic.default_queue,
                              alias:        options[:alias] || interaction,
                              dependency:   options[:dependency],
                              dependencies: options[:dependencies],
                              interaction:  interaction,
                              session:      session,
                              params:       attributes
      end

      def result_of(reference)
        job.send :result, reference
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rasti-app-11.0.0 lib/rasti/app/asynchronic_interaction.rb
rasti-app-10.0.1 lib/rasti/app/asynchronic_interaction.rb
rasti-app-10.0.0 lib/rasti/app/asynchronic_interaction.rb
rasti-app-9.0.0 lib/rasti/app/asynchronic_interaction.rb
rasti-app-8.0.1 lib/rasti/app/asynchronic_interaction.rb
rasti-app-8.0.0 lib/rasti/app/asynchronic_interaction.rb
rasti-app-7.1.1 lib/rasti/app/asynchronic_interaction.rb
rasti-app-7.1.0 lib/rasti/app/asynchronic_interaction.rb
rasti-app-7.0.2 lib/rasti/app/asynchronic_interaction.rb