Commit Graph

94 Commits

Author SHA1 Message Date
David Reiss
c465799c1b erlang: Refactor the write paths of the client and protocol
TODO: squash this

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990980 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:31 +00:00
David Reiss
3f660a4266 erlang: Client refactor, part 1
- 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
2010-08-30 22:05:29 +00:00
David Reiss
480d5ab62b erlang: Separate out thrift_protocol:read_specific
By giving a different name to the function that reads from the
protocol implementation, we can get a slightly more enforcible spec.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990977 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:26 +00:00
David Reiss
1cb979b3d0 erlang: Add a more detailed spec for thrift_protocol:read
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990976 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:25 +00:00
David Reiss
48b8124e32 erlang: Separate out thrift_binary_protocol:read_data
By giving a different name to the function that reads bytes from the
transport, we can get a slightly more detailed spec.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990975 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:23 +00:00
David Reiss
ee93398ccc erlang: Add some more detailed specs for protocol implementations
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990974 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:22 +00:00
David Reiss
9b7fbe3743 erlang: Add some initial specs for thrift_transport and its implementations
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990973 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:20 +00:00
David Reiss
5e6637b0ff erlang: Add some initial specs to thrift_client and thrift_protocol
Also add a special header for use in thrift_protocol implementations
that gives specs for the callbacks.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990972 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:18 +00:00
David Reiss
7772d931a1 erlang: Make framed_transport not write out its buffer when closed
This complicates the code, and users can be expected to call flush
when they want to write data to the underlying transport.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990969 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:15 +00:00
David Reiss
5db982cdf2 erlang: Make buffered_transport not write out its buffer when closed
This complicates the code, and users can be expected to call flush
when they want to write data to the underlying transport.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990968 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:13 +00:00
David Reiss
c0e4b5b246 erlang: Don't print a warning for application-defined exceptions
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
2010-08-30 22:05:12 +00:00
David Reiss
3e81fff832 erlang: Be a little more formal
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990966 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:11 +00:00
David Reiss
6d0be7235c erlang: Spell behaviour properly
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990965 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:09 +00:00
David Reiss
d172a887ff erlang: Export cast/3 from thrift_client (dialyzer warning)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990964 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:08 +00:00
David Reiss
ba5a984271 erlang: Fix a dialyzer warning in thrift_disk_log_transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990963 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:07 +00:00
David Reiss
14da1daf67 erlang: Fix a compiler warning in the disk_log transport
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990962 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:06 +00:00
David Reiss
58d312d516 erlang: Remove some unused modules
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990961 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:05 +00:00
David Reiss
fb2c1ae594 erlang: Enable compiler warnings for the library
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990959 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:02 +00:00
David Reiss
f32d0fb900 Rollback a few recent Erlang changes to fix blame data
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
2010-08-30 22:05:00 +00:00
David Reiss
82c73194df THRIFT-866. erlang: Make specs compatible with Erlang R12
term() wasn't initially supported as an alias for any().

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@988722 13f79535-47bb-0310-9956-ffa450edef68
2010-08-24 20:52:56 +00:00
Bryan Duxbury
d3879f80c6 THRIFT-599. erl: Don't use unnecessary processes in the Erlang transports and clients
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
2010-08-19 05:06:02 +00:00
David Reiss
d09f09c89d THRIFT-784. erl: Fix two problems with "make install"
- Support DESTDIR.
- Pass proper arguments to install.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@945898 13f79535-47bb-0310-9956-ffa450edef68
2010-05-18 21:32:16 +00:00
David Reiss
9e2fd7987d THRIFT-646. erlang: Misc build cleanups
- 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
2010-05-18 16:52:48 +00:00
Bryan Duxbury
7173bd96bd THRIFT-646. erl: Erlang library is missing install target
This patch adds a new install target to the erlang makefile. It also converts the Makefile to Makefile.am

Patch: Anthony Molinaro

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@940326 13f79535-47bb-0310-9956-ffa450edef68
2010-05-02 22:54:22 +00:00
Todd Lipcon
53ae9f39d5 THRIFT-622. Add appropriate licensing information to get Thrift ready for a release.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@887812 13f79535-47bb-0310-9956-ffa450edef68
2009-12-07 00:42:38 +00:00
David Reiss
b42361c2e9 THRIFT-574. erlang: Support framed transport for servers
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@813054 13f79535-47bb-0310-9956-ffa450edef68
2009-09-09 17:18:57 +00:00
David Reiss
1e1a697672 THRIFT-211. erlang: Support "tethered" clients
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
2009-06-04 02:01:32 +00:00
David Reiss
bb97fd90a5 THRIFT-211. erlang: Allow clients to be created without connecting
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
2009-06-04 02:01:28 +00:00
David Reiss
5e530af587 THRIFT-211. erlang: Support unlinked Thrift clients.
- 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
2009-06-04 02:01:24 +00:00
Bryan Duxbury
def30a6072 THRIFT-387. Add appropriate Apache header to all code files
This hits all the documentation and some misc code files that have avoided the license up to this point.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@763048 13f79535-47bb-0310-9956-ffa450edef68
2009-04-08 00:19:37 +00:00
David Reiss
deda141392 THRIFT-388. Create a "ONEWAY" message type that is an alias for "CALL"
Pave the way for a new message type for oneway function calls.
For now, just define the constant in all languages and make
server implementations treat it the same way as a normal call.
Only C++ and Erlang currently check the message type (on the
server side).

There is a little bit of redundancy in the Erlang code, but
the alternative is a bit gross, and this split-up will be
necessary eventually when we start handling one-way calls
differently.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@761389 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 19:22:31 +00:00
David Reiss
ea2cba8ba8 THRIFT-387. Add license headers to a bunch of files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760189 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 21:35:00 +00:00
David Reiss
45c27793cf THRIFT-307. erlang: Make HiPE optional
You can still use it by running "make ERLC_FLAGS='+native'".


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760166 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 20:47:05 +00:00
David Reiss
2d8563ed6e THRIFT-306. erlang: Let thrift_http_transport specify custom HTTP headers
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760165 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 20:47:01 +00:00
David Reiss
4c0234f815 THRIFT-305. erlang: Fix http_options for thrift_http_transport
The old implementation of thrift_http_transport:set_http_options assumed
that the return value of thrift_transport:new was a pid, but it isn't.
It is a private structure.  Therefore, set_http_options could never work.
Now, thrift_http_transport:new takes an optional third argument,
an assoc-list of options, including http_options.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760164 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 20:46:56 +00:00
David Reiss
233ace53f0 THRIFT-127. erlang: Skip fields that have the wrong type
In the other languages (AFAIK), if a field has the wrong type,
it is silently skipped.  Erlang currently assumes that the type
is correct and de-synchronizes.  This change makes it behave like
the other languages (except that it is not silent).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760161 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 20:46:47 +00:00
David Reiss
bfc57a0402 THRIFT-126. erlang: TMemoryBuffer for Erlang
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760160 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 20:46:37 +00:00
David Reiss
fe931d1526 THRIFT-136. s/async/oneway/ in Erlang
This is kind of a bummer because it requires a simultaneous
code regeneration and library upgrade, and possibly also a
server restart.  I'm not sure if it is worth it, since the
only benefit is a little code clarity.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757993 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:02:08 +00:00
David Reiss
6ce401dd55 THRIFT-136. s/async/oneway/ in misc places
This is mostly an internal-only change.
It affects docstrings, messages, variables, test cases, etc.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757992 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:01:58 +00:00
David Reiss
c51986f438 THRIFT-136. s/async/oneway/ in comments
This is an internal-only change.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757990 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 20:01:25 +00:00
Kevin Clark
9a863ee551 THRIFT-192. erl: Fix handling of booleans
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757870 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 16:04:36 +00:00
David Reiss
080991bf98 THRIFT-186. erl: Make the Makefile work on OpenSolaris
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@709086 13f79535-47bb-0310-9956-ffa450edef68
2008-10-30 04:28:42 +00:00
David Reiss
46e8d0b8fb THRIFT-94. erlang: Fix a syntax error
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@678659 13f79535-47bb-0310-9956-ffa450edef68
2008-07-22 06:57:41 +00:00
David Reiss
7a4ff6be4d THRIFT-83. erlang: Don't flush an empty buffer in the http transport.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@677157 13f79535-47bb-0310-9956-ffa450edef68
2008-07-16 05:13:30 +00:00
David Reiss
cc0c9e98b5 Clean up some bad/missed merges from the alterl merge.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666486 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:29 +00:00
David Reiss
37dbfef478 Fix thrift_server to work with newest thrift_processor
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666483 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:16:01 +00:00
David Reiss
9f2a5d7799 Rename "alterl" to "erl".
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666481 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:15:45 +00:00
David Reiss
f2e66c1cb7 Remove all of the old Erlang stuff in preparation for renaming alterl.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666480 13f79535-47bb-0310-9956-ffa450edef68
2008-06-11 01:14:38 +00:00
David Reiss
13c4380347 Add a distdir rule to lib/erl/Makefile to make "make check" happy.
This is a gross hack because lib/erl isn't using automake,
but it is still in SUBDIRs.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665661 13f79535-47bb-0310-9956-ffa450edef68
2008-04-21 18:07:49 +00:00
David Reiss
1d106ae6f0 Add simple "check" and "distclean" targets to lib/erl/Makefile.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665655 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 22:00:06 +00:00