module Sequel::ThreadedServerBlock

  1. lib/sequel/extensions/server_block.rb

Adds with_server support for the sharded threaded connection pool.

Methods

Public Instance

  1. with_server

Public Instance methods

with_server(default_server, read_only_server=default_server)

Set a default server/shard to use inside the block for the current thread.

[show source]
    # File lib/sequel/extensions/server_block.rb
133 def with_server(default_server, read_only_server=default_server)
134   begin
135     set_default_server(default_server, read_only_server)
136     yield
137   ensure
138     clear_default_server
139   end
140 end