Sha256: 4b6d0f47c6e89dff19cb010d808b3027f2c309cda17df507e441d3e68dc5930a

Contents?: true

Size: 453 Bytes

Versions: 4

Compression:

Stored size: 453 Bytes

Contents

# frozen_string_literal: true

module Dry
  module Effects
    module Effects
      class Parallel < ::Module
        Par = Effect.new(type: :parallel, name: :par)
        Join = Effect.new(type: :parallel, name: :join)

        def initialize
          super

          define_method(:par) { |&block| ::Dry::Effects.yield(Par).(&block) }
          define_method(:join) { ::Dry::Effects.yield(Join.payload(_1)) }
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-effects-0.5.0 lib/dry/effects/effects/parallel.rb
dry-effects-0.4.1 lib/dry/effects/effects/parallel.rb
dry-effects-0.4.0 lib/dry/effects/effects/parallel.rb
dry-effects-0.3.1 lib/dry/effects/effects/parallel.rb