Sha256: 3e061ad53ae1c872c3d88c7ec2c462ad396d7588dc8e7c88866406c51ed8306a

Contents?: true

Size: 258 Bytes

Versions: 7

Compression:

Stored size: 258 Bytes

Contents

module Tako
  class ProxyStack
    class << self
      def top
        @current
      end

      def with_shard(proxy)
        previous ||= @current
        @current = proxy

        yield
      ensure
        @current = previous
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tako-0.6.0 lib/tako/proxy_stack.rb
tako-0.5.0 lib/tako/proxy_stack.rb
tako-0.4.1 lib/tako/proxy_stack.rb
tako-0.4.0 lib/tako/proxy_stack.rb
tako-0.3.2 lib/tako/proxy_stack.rb
tako-0.3.1 lib/tako/proxy_stack.rb
tako-0.3.0 lib/tako/proxy_stack.rb