• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

iconara / ione / 164
100%
master: 99%

Build:
Build:
LAST BUILD BRANCH: v1.2.4
DEFAULT BRANCH: master
Ran 11 Dec 2014 10:38PM UTC
Jobs 5
Files 13
Run time 8min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
164

push

travis-ci

Gustav Munkby
Proof-of-concept destructive future combinators

Implement destructive versions of the combinators, that updates the
existing future rather than creating a new one. The new combinators
ought to be thread-safe, but interleaving destructive updates might
produce counter-intuitive results sometimes. However, the common use
case seems to be synchronous construction of an asynchronous future
chain, in which case these combinators might reduce memory footprint
and call stack depth.

This is made possible by not resolving a future until after the
callbacks have completed. This is obviously a backwards-incompatible
change, as it causes any code with a `#value` in a callback to hang
indefinitely.

An obvious alternative would be to treat "transformations" and
"callbacks" separately, but I tried to avoid introducing further
bookkeeping surrounding the callbacks. 

Another advantage of keeping callbacks and transformations in a list
is that synchronous transformations behave as expected. That is, if
you add a listener before and after a `map!` is applied, the first
callback will receive the unmapped value, and the second callback will
receive the transformed value.

The future chaining transformations (`flat_map`, `then` and `fallback`)
requires some way to stop the listener dispatch in order to implement
the destructive versions. Here, this is accomplished by using the
return value of the listener callback. There is probably a better way
to get the same effect. To avoid breaking existing callbacks, this was
separated into the `on_complete!` callback.

To avoid too much code duplication, the non-destructive operation `foo`
is implemented using `dup.foo!`, similar to how non-destructive array
operations can be implemented. Not quite sure `dup` is the right name
for the newly constructed future (observing on the original), though.

I made some minor adjustments to the remaining code to get the future
specs to pass, but these are probably not 100% correct.

I have ... (continued)

2389 of 2393 relevant lines covered (99.83%)

9484.67 hits per line

Jobs
ID Job ID Ran Files Coverage
1 164.1 (1.9.3) 11 Dec 2014 10:38PM UTC 0
98.65
Travis Job 164.1
2 164.2 (2.0.0) 11 Dec 2014 10:40PM UTC 0
99.03
Travis Job 164.2
3 164.3 (2.1.1) 11 Dec 2014 10:45PM UTC 0
99.03
Travis Job 164.3
4 164.4 (jruby) 11 Dec 2014 10:47PM UTC 0
98.61
Travis Job 164.4
5 164.5 (jruby-head) 11 Dec 2014 10:41PM UTC 0
0.0
Travis Job 164.5
Source Files on build 164
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #164
  • 4d9aff6d on github
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc