Ryan Greenberg
3ec894d476
Extract wrapped exception class creation
...
The wrapped exception classes are not created until ThriftClient.new
is called with the correct client class. This makes it difficult to
write code like `rescue MyThrift::Client::TransportException` because
the exception class may not exist yet.
Callers may now use ThriftClient.create_wrapped_exception_classes to
ensure the desired classes have been created.
2014-03-19 17:46:06 -07:00
Jeff Smick
d8ad5961ab
only show connection string on NoServersAvailable
2013-04-11 08:59:06 -07:00
Jeff Smick
d571b5dc13
apply global timeout to connection management
2013-02-26 11:24:55 -08:00
Jeff Smick
c0155507d1
respect connect_timeout on reconnect
...
Thrift::Socket reuses the timeout value for both connection and
request timeouts.
2012-11-15 13:13:04 -08:00
Jeff Smick
51a9adab97
ensure socket alignment
...
If a request is interrupted before data can be read off the socket
a misalignment can occur whereby subsequent requests will get responses
from previous requests.
2012-11-15 10:00:39 -08:00
Jeff Smick
68a8bfc072
reduce object churn
...
Cache the connection and client in the server object. If a client
is cleanly disconnected we don't need to tear it all down. This will
mean any negotiations made at the protocol level will hold when the
client reconnected. However the post_connect callback at the
application layer will still be called.
2012-11-15 09:48:39 -08:00
Brandon Mitchell
4863efcc77
Docs.
2012-09-11 10:13:01 -07:00
Brandon Mitchell
28b62e5c6c
Spelling.
2012-09-10 15:30:09 -07:00
Brandon Mitchell
92f3aedb74
(optionally) Cache connections to amortize connect() costs.
2012-09-10 15:25:25 -07:00
Brandon Mitchell
9d33fcc33c
Use Server as a proxy between the underlying Thrift transport and the thrift client.
2012-09-10 14:55:29 -07:00
Brandon Mitchell
ab27b71883
Push Connection into ThriftHelpers to prevent namespace pollution.
2012-09-10 13:36:58 -07:00
Brandon Mitchell
d490a2b663
Remove disconnect_on_error.
2012-09-10 13:34:41 -07:00
Brandon Mitchell
9903841e36
Needless method.
2012-09-10 13:34:41 -07:00
Brandon Mitchell
c13073ca79
Push downedness into Server.
2012-09-10 13:34:41 -07:00
Brandon Mitchell
896a5c20c2
Push AbstractThriftClient::Server into its own module.
2012-09-10 13:34:41 -07:00
Brandon Mitchell
a0c24755e9
Mark servers down after connect()-related errors.
2012-09-10 11:16:16 -07:00
Ilya Maykov
25ca0d6099
Added support for :before_method and :on_exception callback types. Added support for registering multiple callbacks of a given type.
2011-08-23 00:40:47 -07:00
Ryan King
25a03835d9
rename exception_classes_without_disconnect to exception_class_overrides for clarity
2011-08-08 13:13:13 -07:00
Kelley Reynolds
e5ed23c865
Added exception_classes_without_disconnect to handle Thrift::Exceptions that do not require a disconnect and reconnect
2011-08-05 21:15:50 -04:00
Brandon Mitchell
c3bb880780
Merge branch 'master' of github.com:fauna/thrift_client
2011-06-09 11:34:00 -07:00
Brandon Mitchell
0cbefc7f1e
Fixup socket timeouts.
2011-06-09 11:33:42 -07:00
Mike Heffner
a02c35b069
Add a method `add_callback` allowing a client to register a block that
...
is invoked at a certain event. Supports :post_connect as the only
event initially.
This will allow a client to hook into the reconnect logic when a
connection to a particular thrift server dies. For example, cassandra
must set the keyspace and (optionally) authenticate before commands
can be retried.
2011-06-09 13:28:58 -04:00
Lennon Day-Reynolds
384cf4e951
set transport timeout after connection is established
2011-06-08 17:19:48 -07:00
ivmaykov
2808b18bbc
Add support for specifying client-side timeouts when using FramedTransport
2011-05-24 17:31:31 -07:00
Robert Jackson
8e1eb7f7da
Document the :connect_timeout option.
2011-05-24 16:33:57 -04:00
Erik Michaels-Ober
5e3ffebe7a
No need to require rubygems or specify the gem version for thrift
2011-05-09 12:46:29 -07:00
Brandon Mitchell
559d025025
Expose a discrete timeout for connect(2).
2011-02-16 14:53:49 -08:00
Matt Conway
c15d5ca700
depend on thrift v0.5.0, regen test greeter interface
2010-10-28 13:05:58 -04:00
Ryan King
d0cde4a8c8
only mark the current server down if we have a current server
2010-09-27 12:16:43 -07:00
Ryan King
ddc675298f
update docs
2010-09-22 16:48:46 -07:00
Ryan King
b28ec57236
get more specific about thrift version
2010-09-22 16:47:09 -07:00
Ryan King
aa522a6bdc
stop retrying on ProtocolException
2010-09-17 10:19:54 -07:00
Ryan King
a71807bc55
stop doing free retries on connect
...
Before this change we would retry indefinitely on connection errors. Now connections errors count against the retry budget.
2010-09-16 15:04:05 -07:00
Ryan King
719a6d349c
add back in the randomization
2010-09-15 11:34:27 -07:00
Ryan King
3c4b16c148
simplify the code a bit
2010-09-14 15:44:12 -07:00
Ryan King
638f3b6b58
move fix the server_retry_period to work the way you expect it to work
2010-09-14 13:57:50 -07:00
Ryan King
650dec001a
rename next_server to next_live_server
2010-09-14 12:01:41 -07:00
Ryan King
f4c1eabed8
get rid of randomize_server_list and always randomize
2010-09-14 12:00:04 -07:00
Ryan King
69f2727c44
add Server class for keeping state about a server
2010-09-13 17:19:57 -07:00
Ryan King
20fc22a758
more simplification
2010-09-13 17:17:12 -07:00
Ryan King
d884cbbabf
clean up exception handling codes
2010-09-13 17:13:42 -07:00
Ryan King
5846bfc385
add a few TODOs around blanket rescues
2010-09-13 16:50:16 -07:00
Ryan King
bd6a4f4918
simplify initialize method
2010-09-13 16:44:54 -07:00
Ryan King
1a4e8d8f74
merge options defaults
2010-09-13 16:37:37 -07:00
Ryan King
c5e1d19214
death to RetryingThriftClient
2010-09-13 16:27:15 -07:00
Ryan King
d3a5548d86
kill TimingOutThriftClient
2010-09-13 16:17:58 -07:00
Ryan King
987222201c
wrap exceptions in client-specific classes
2010-09-09 21:24:26 -07:00
Ryan King
01e7e181a4
fix retries documentation
2010-09-07 11:10:11 -07:00
Ben Matasar
b9ce99e8bf
Merge branch 'master' of https://github.com/fauna/thrift_client
2010-08-02 12:57:22 -07:00
Matt Freels
6e74545f63
really fix retries and add test coverage
2010-07-28 16:16:14 -07:00