diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-12-11 21:30:35 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-12-15 12:55:30 +1000 |
commit | 1333b3837d405c31baaa44d1db89aab0f7d09349 (patch) | |
tree | bcceb74cff609645543c07c7114ef24a468360d5 /.travis.yml | |
parent | 61b4c183fa2392522051305ec12ab5f433cc09a7 (diff) | |
download | scala-async-1333b3837d405c31baaa44d1db89aab0f7d09349.tar.gz scala-async-1333b3837d405c31baaa44d1db89aab0f7d09349.tar.bz2 scala-async-1333b3837d405c31baaa44d1db89aab0f7d09349.zip |
Avoid unbounded stack consumption for synchronous control flow
Previously, as sequence of state transitions that did not pass through
an asynchrous boundary incurred stack frames. The trivial loop in
the enclosed test case would then overflow the stack.
This commit merges the `resume` and `apply(tr: Try[Any])` methods into
a `apply`. It changes the body of this method to be an infinite loop
with returns at the terminal points in the state machine (or at a
terminal failure.)
To allow merging of these previously separate matches, states that
contain an await are now allocated two state ids: one for the setup
code that calls `onComplete`, and one for the code in the continuation
that records the result and advances the state machine.
Fixes #93
Diffstat (limited to '.travis.yml')
0 files changed, 0 insertions, 0 deletions