Commit Graph

54 Commits

Author SHA1 Message Date
Jon Parise
8b050d8dd6 Update some ProtocolHandler @spec's (#213)
start_link/5's @spec wasn't updated when it signature was last changed.
Also add a @spec to init/6 and mark some internal functions as private.

We only support :ranch_tcp at the moment, so that's explicitly enforced
in both the typespecs as well as the init/6 function head.
2017-02-07 12:11:03 -08:00
Jon Parise
a34861c4b2 Upgrade Credo to version 0.6.0 (#200)
This also disables the "Readability.Specs" check because it appears to
crash Credo when it encounters some of our macro-ized code. That can be
investigated separately.
2017-01-26 08:43:47 -08:00
Jon Parise
8b1728294f Update dependencies for Elixir 1.4 compatibility (#166)
This are all relatively minor updates to newer releases, many of which
address new Elixir 1.4 warnings.
2017-01-08 10:00:27 -08:00
Jon Parise
fb2dfee7db Bump our minimum Elixir version to 1.3 (#126)
This gives us the ability to use 1.3+ APIs as we develop our 2.0 branch.
Many other libraries (Absinthe, Dialyxir) also have a 1.3+ requirement.

Also, Elixir 1.4 is imminent, so add that to our testing matrix too.
2017-01-02 14:32:46 -08:00
Steve Cohen
cb372ecb07 Binary Framed server (#116)
* Binary Framed server

This is the implementation of the binary thrift framed server. It features
a configurable acceptor pool and generates code to make serialization and
deserialization automatic.
2017-01-02 14:06:55 -08:00
Jon Parise
aec78ba97d Fix main reference to the README document (#123)
This appears to be case-sensitive, and I wasn't noticing because the
macOS's file system isn't.

Also, remove the Apache License batch from the README because it doesn't
render that well as part of the generated documentation. We may want to
remove the other badges later too if we continue to use the README as a
key part of our Hex-published docs.
2016-12-31 11:46:14 -08:00
Jon Parise
1f5462bba8 Remove the Apache Thrift Erlang runtime library (#122)
We still have a copy under test/support/src/ that's used by our
integration tests, but we otherwise no longer have any need to ship a
copy of Apache Thrift Erlang runtime.
2016-12-31 09:02:51 -08:00
Jon Parise
fa4d091fdb Update packaging to reflect our 2.0.0-dev status (#117) 2016-12-30 16:09:25 -08:00
Jon Parise
0517ba9485 Restructure env-specific builds paths (#114)
Define :test-specific (instead of :prod-specific) lists of build paths.
This fixes an issue where :dev builds would include test code and things
like `mix docs` would parse and document tests.

Because our benchmarks also use test code (e.g. ParserUtils), that
command is runs in the :test environment.
2016-12-30 14:34:17 -08:00
Jon Parise
54e163c311 Add Preston to the maintainers list (#109) 2016-12-30 13:13:01 -08:00
Dan Swain
1af7c4ee1d Clean up some dialyzer warnings (#110)
Mostly this was just configuring dialyzer.  The jsx version update is to
clear a dialyzer crash that the old version caused.
2016-12-30 13:12:41 -08:00
Jon Parise
faed878956 Merge branch 'master' into thrift_tng 2016-12-29 09:46:06 -08:00
Jon Parise
06d2d75680 Only build dialyxir in :dev
Also, exclude it from the list of runtime applications because it has no
runtime component.
2016-12-29 07:59:34 -08:00
Jon Parise
6963b315db Add _bench.exs suffixes to benchfella scripts (#96)
This allows the `mix bench` command to automatically discover its test
scripts.

Also, we only need to build benchfella in :dev and not :test.
2016-12-28 16:35:15 -08:00
Steve Cohen
0c7bcac1eb Generated Thrift client (#72)
* Generated Thrift client
This PR is the start of an auto-generated Framed Thrift Binary Protocol
client.
Some work was needed in order to make the client work. This included
modifying the existing generators to:

  * Properly handle void return types
  * Create exceptions using defexception rather than defstruct.

I also modified the thrift test case so it was able to pass context from
setup functions. This is necessary because testing is accomplished by
creating an erlang server off of a test client and running actual thrift
calls against it. I've validated a number of different scenarios, and
all appear to work
2016-12-24 17:29:44 -08:00
Jon Parise
ac9f53856f Merge branch 'master' into thrift_tng 2016-12-23 14:29:32 -08:00
Jon Parise
164d8d6abf We don't need to set MIX_ENV for mix coveralls
This is already handled by our `preferred_cli_env` setup.
2016-12-23 14:08:28 -08:00
Jon Parise
230106baa8 Try out Ebert for automated code reviews 2016-12-23 12:48:39 -08:00
Jon Parise
81816b15cd Include README in docs and fix version linking 2016-12-09 12:35:05 -08:00
Steve Cohen
1f922d9f33 Remove tng thrift (#67)
* Revert "Added support for ordinals (#62)"

This reverts commit b3ec59a87b.

* Revert "Add serialization test for i32, i64, double (#61)"

This reverts commit 2145c105e8.

* Revert "Fix CompactProtocol warning (#60)"

This reverts commit f5c5a1067e.

* Revert "Support file argument to thrift.generate (#59)"

This reverts commit a35c8a723b.

* Revert "Pure elixir implementation (#54)"

This reverts commit 819216f830.
2016-12-09 11:17:08 -08:00
Jon Parise
4c71e984e7 Fix Elixir 1.4 "function call ambiguity" warnings (#65) 2016-12-09 10:12:01 -08:00
Preston Guillory
819216f830 Pure elixir implementation (#54)
A pure Elixir implementation of the Thrift binary protocol.

This PR includes serialization and deserialization for all thrift types as well as testing to make sure we match the thrift spec (which can be found here: https://erikvanoosten.github.io/thrift-missing-specification/#_binary_encoding)

The binary protocol is generated alongside the thrift data types, yielding a much faster implementation than the apache project's canonical one. 

Our benchmarks (using benchfella) indicate a speedup of between 10 and 20x.

## Binary Protocol Performance
benchmark name |  iterations | average time 
------------------|-----------|---------------
elixir serialization (left as IOList)                   |  2000  | 849.01 µs/op
elixir serialization (iolist_size)                        |  2000  | 933.83 µs/op
elixir serialization (converted to binary)        | 1000   | 1281.23 µs/op
elixir deserialization                                       |  1000   | 1178.46 µs/op
erlang serialization left as IOList                    |   100   | 10284.84 µs/op
erlang serialization (converted to binary)      |   100   | 11588.89 µs/op
erlang deserialization                                      |   100   | 21433.17 µs/op
2016-11-30 11:31:59 -08:00
Jon Parise
4857b40275 Preparing the 1.3.1 release 2016-11-15 16:12:35 -08:00
Jon Parise
440df4f67b Update to credo 0.5.2 and dialyxir 0.4.0 (#34) 2016-11-10 16:32:00 -08:00
Jon Parise
ef89a6fa41 Upgrade excoveralls to version 0.5.7
This fixes some compile issues with Elixir 1.3 and 1.4. It also updates
its dependencies.
2016-10-18 16:14:35 -04:00
Jon Parise
1af5b3b25d Upgrade credo to version 0.4.12
This is a very minor upgrade, but it fixes some compile-time warnings.
2016-10-18 16:10:56 -04:00
Jon Parise
abff932379 Switch to the dialyxir package (#27)
The dialyze package has been deprecated in favor of dialyxir.
2016-10-18 16:07:34 -04:00
Jon Parise
58e1204577 Upgrade ex_doc and earmark to the latest versions (#25) 2016-10-18 15:30:37 -04:00
Jon Parise
69fffda26e Upgrade to ex_doc 1.4 2016-09-30 09:17:17 -07:00
Jon Parise
441777efdf Prepare the 1.3.0 release (#19) 2016-09-15 07:49:55 -07:00
Jon Parise
1c3e64a947 Improve the top-level Thrift module docs (#20)
Also, update our ex_doc and earmark dependencies.
2016-09-15 07:49:14 -07:00
Jon Parise
6418e020fc Upgrade to credo 0.4.11 (#18)
No new issues were flagged as a result of this upgrade.
2016-09-14 17:00:36 -07:00
Jon Parise
8c75213a59 Require at least Elixir 1.2 (#11)
With today's release of Elixir 1.3, now is a good time to drop compatibility
with much older releases. This also lets us use some of the nicer language
features introduced in Elixir 1.2, like the multi-alias syntax.
2016-06-21 08:56:00 -07:00
Jon Parise
c288cbe9e6 Update to Credo 0.4.5
This change also fixes the new code readability warnings that it found.
2016-06-20 13:11:16 -07:00
Jon Parise
8fa4589443 Add Credo to the [:dev, :test] build 2016-06-17 10:19:51 -07:00
Jon Parise
d65ce2a548 Upgrade to ex_doc 0.12.0 2016-06-17 08:33:32 -07:00
Steve Cohen
bb1c1a4dce An implementation of the Thrift parser
This PR introduces a parser based on @jparise's lexer. The parser
runs on thrift files and produces a set of Program models. The
intention is to be able to give Elixir full-fledged thrift support
and a better implementation.
2016-06-14 08:53:54 -07:00
Jon Parise
90438d74bd Prepare version 1.2.1 2016-05-29 17:45:01 -07:00
Jon Parise
e72c331e71 Clarify that we include parts of Apache Thrift 2016-05-29 17:44:05 -07:00
Jon Parise
a5d90a015a Upgrade excoveralls to version 0.5.4 2016-05-25 08:13:45 -07:00
Jon Parise
335f7e742f Prepare the 1.2.0 release. 2016-02-13 13:11:10 -08:00
Jon Parise
9ef8a896a2 Swith to the hex version of excoveralls. 2016-02-13 13:05:42 -08:00
Jon Parise
92b2ff4e96 Upgrade ex_doc and earmark to latest versions. 2016-02-13 13:03:13 -08:00
Jon Parise
4d976d558d Upgrade excoveralls to version 0.4.6. 2016-02-13 13:01:25 -08:00
Jon Parise
a955a09747 Reduce the size of the packaged Apache Thrift lib.
We only need the Erlang bits, so only package those along with the top-level
project documents.
2016-02-02 14:04:45 -08:00
Jon Parise
6284a12fc9 Add documentation support via ex_doc. 2016-02-02 10:34:09 -08:00
Jon Parise
ae4c6cb00c Bump version to 1.1.0. 2016-02-02 10:15:04 -08:00
Jon Parise
12407035ff Update excoveralls to version 0.4.5. 2016-01-18 19:42:27 -08:00
Jon Parise
4b28b5a979 Provide a leex-based Thrift IDL lexer.
This represents just the lexer definition. Full grammar parsing (i.e. yecc)
support will come later.

The lexer definition is largely complete, but there may be some issues with
string literals containing escaped characters \t and \n.
2016-01-18 19:32:02 -08:00
Jon Parise
2358ad6b9f Quote the package files: list using ~w(). 2016-01-18 19:15:59 -08:00