Commit Graph

8 Commits

Author SHA1 Message Date
Sarat Chandra Balla
5114c14333 replace System.stacktrace/0 with __STACKTRACE__ 2021-05-07 02:09:28 +05:30
Preston Guillory
b03a91b35c Compile enums into case statements
Elixir is slow to compile functions with many heads, which is how we generate
enums in this library. It's faster to compile an equivalent case statement
inside a single function head. I observed that it reduced the time to compile
an enum with about 2500 values from 24s to 3s.
2020-10-19 18:16:59 -07:00
Preston Guillory
8e9aec629a
Eliminate redundant 'Elixir.' prefixes (#515)
Minor refactor for readability of compiled code.
2020-10-19 11:39:31 -07:00
Preston Guillory
d6bfeea36b
Clean up redundant parentheses in generated server code (#514)
Minor refactor to make the generated code a little more readable.
2020-10-19 10:12:49 -07:00
Jon Parise
02cf636bd3
Revise generated server function catch clauses (#497)
wrap_with_try_catch/4 wraps a function handler body with a try/1.

Our previous approach used `rescue` clauses for exception types defined
for this function in the schema. When no exception types are defined,
this resulted in us passing [] (empty list) into the macro as the
`rescue` argument. Elixir 1.10 doesn't like that:

  expected -> clauses for :rescue in "try"

This revised approach moves exception type handling into the existing
`catch` list (and does away with `rescue`), merging them with our
existing `catch` clause that is common to all server functions. This
guarantees that we always have at least one clause to expand in the
macro.
2020-03-26 12:49:24 -07:00
Jon Parise
2394eb3a17 Re-apply mix format 2018-09-02 10:24:37 -07:00
Jon Parise
050e691be2 Regenerate the example's generated files
This includes the `@moduledoc false` changes we recently made to the
Thrift generators.

The rest of the formatting changes come from regenerating these files
under Elixir 1.7.
2018-09-02 10:02:07 -07:00
Michael Oliver
76cc14d637
Add an example project (#412)
* Add an example project

* Fix credo/ebert issues

* Re-run formatter

* add vector products to example, capitalize Thrift, change divide matching
2018-08-28 17:12:45 -07:00