> Awesome :).  I plan to play with this later today.  I'll be sure to
> send my feedback.

I've tried it out and it works as advertised :).  The one thing that
confused me a bit was this note [1] from the docs:

# Note that this extension only works with the sharded threaded
connection
# pool.  If you are using the sharded single connection pool, you need
# to switch to the sharded threaded connection pool before using this
# extension.

It confused me a bit because I hadn't given previous thought to
picking a connection pool.  I wasn't sure which one I was using, or
how to go about ensuring I was using the sharded threaded connection
pool.  I dug around in the sources a bit and it looks like it uses a
threaded connection pool unless you pass :single_threaded.  To use a
sharded connection pool, it looks like I have to pass a `:servers`
option (even if it's just an empty hash).

Putting it all together, this is what my connection setup is now:

https://gist.github.com/1928153

Seems to be working like a charm!

One final thing: I specified a default proc that raises an error, but
it doesn't seem to ever get used, as far as I can tell.  When I try to
access the DB (without first wrapping it in `with_server`), then I get
an error form sequel:

DB[:users].count
=> Sequel::DatabaseError: Mysql2::Error: No database selected
        from /Users/myron/.rvm/gems/ruby-1.9.3-p125@vanguard/bundler/gems/
sequel-f1e2f3754d14/lib/sequel/adapters/mysql2.rb:85:in `query'
        from /Users/myron/.rvm/gems/ruby-1.9.3-p125@vanguard/bundler/gems/
sequel-f1e2f3754d14/lib/sequel/adapters/mysql2.rb:85:in `block in
_execute'

This is fine (desirable, even). Is the default proc still needed?  If
so, what are the conditions that would trigger its use?

Thanks,
Myron

[1] 
https://github.com/jeremyevans/sequel/blob/f1e2f3754d14b8384b51f6aaba77614881ed6f9d/lib/sequel/extensions/arbitrary_servers.rb#L53-56

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to