Sha256: 25e8c512ffee82faf48160b776f34db96faf5490a278978a5234081460116a5a

Contents?: true

Size: 800 Bytes

Versions: 4

Compression:

Stored size: 800 Bytes

Contents

module Rasti
  class App
    class AsynchronicInteraction < Interaction

      private

      def job
        @job ||= Asynchronic[context.fetch(:job_id)].job
      end

      def enqueue(interaction, params)
        job.send :async, Job, queue:        params.delete(:queue) || Asynchronic.default_queue,
                              alias:        params.delete(:alias) || interaction,
                              dependency:   params.delete(:dependency),
                              dependencies: params.delete(:dependencies),
                              interaction:  interaction,
                              context:      context,
                              params:       params
      end

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

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rasti-app-0.0.4 lib/rasti/app/asynchronic_interaction.rb
rasti-app-0.0.3 lib/rasti/app/asynchronic_interaction.rb
rasti-app-0.0.2 lib/rasti/app/asynchronic_interaction.rb
rasti-app-0.0.1 lib/rasti/app/asynchronic_interaction.rb