Add a transport implementation that forwards all read and write (and
flush and close) requests directly to a wrapped transport. In addition,
it keeps a small amount of state: a version number that is incremented
on each operation and the PID of a process that stores another copy of
the version number. Every operation compares the version numbers and
increments both. If some part of the Thrift stack doesn't propagate
state updates properly, the two versions will not match.
Also add some (compiled-off by default) code to thrift_transport to
auto-wrap every transport in a state checker.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990990 13f79535-47bb-0310-9956-ffa450edef68
Note that the buffering transports still use a separate process to
maintain their state. This change just changes them to use a
"return-the-new-version"-style API.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990989 13f79535-47bb-0310-9956-ffa450edef68
- Client is no longer a separate process.
- Simplified constructors moved into another module.
- All functions and exceptions return the new client,
to allow for future statefulness in the client.
NOTE: With the new library and old gen-code, attempting to call a
nonexistent function will result in an exit.
TODO: fix docs and tests (tether test is not meaningful)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990979 13f79535-47bb-0310-9956-ffa450edef68
Application-defined exceptions are a normal occurrence as far as the
Thrift infrastructure is concerned, so we should not print a warning.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990967 13f79535-47bb-0310-9956-ffa450edef68
My combined patch for THRIFT-599 was committed, but it is preferable
commit the individual patches to preserve the more detailed log and
blame data. I'll recommit r987018 as a sequence of patches and r988722
as its own rev.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990957 13f79535-47bb-0310-9956-ffa450edef68
The only user-visible changes are to the client. Every thrift call now returns {NewClient, Result} instead of just Result.
Patch: David Reiss (assist to Anthony Molinaro)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987018 13f79535-47bb-0310-9956-ffa450edef68
- Use AC_ERLANG_PATH_ERLC to find erlc, instead of the generic
AC_PATH_PROG.
- Also check for erl, just in case it is used internally by checks.
- Use AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR instead of manual hackery to
find the location where Erlang libraries should be installed. (This
doesn't use the discovered version of Erlang, though. See
http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00003.html .)
- Minor style changes in Makefile.am
- Remove some hacks we were using in the old makefile that were
necessary because we were not using automake.
- Remove ebin in a "maintainer-clean-local" rule to avoid shadowing the
default "maintainer-clean" rule which handles MAINTAINERCLEANFILES.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@945744 13f79535-47bb-0310-9956-ffa450edef68
Add a client option that causes clients to monitor their creators
and terminate when the creator dies. This makes it possible to
prevent client leaks without linking, because the latter causes
application code to be killed when a transport error occurs and
exits are not trapped.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@781636 13f79535-47bb-0310-9956-ffa450edef68
Add a client option to prevent the initial connect (which causes
the protocol factory to be ignored). The main use case for this
is testing the proper handling of clients that cannot connect.
Update the tether test to use this feature instead of a raw
gen_server:start call.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@781635 13f79535-47bb-0310-9956-ffa450edef68
- Create a thrift_client:start function that accepts client options.
- Make start_link a wrapper that adds {monitor, link}.
- Add a test to make sure that everything dies or doesn't die as expected.
(The test has to be run manually.)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@781634 13f79535-47bb-0310-9956-ffa450edef68