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

iconara / ione
100%
master: 99%

Build:
Build:
LAST BUILD BRANCH: v1.2.4
DEFAULT BRANCH: master
Repo Added 02 Mar 2014 06:43PM UTC
Files 12
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

LAST BUILD ON BRANCH destructive-future-combinators
branch: destructive-future-combinators
CHANGE BRANCH
x
Reset
  • destructive-future-combinators
  • 1.2.0.pre4
  • acceptor-host-and-port
  • after-factory
  • byte-buffer-getbyte
  • byte-buffer-index
  • deprecate-future-value
  • fix-jruby-test-issues
  • fix-warnings
  • future_improvements
  • handle_badf_in_select
  • http_server
  • improve-base-connection-locks
  • io-reactor-drain
  • master
  • optimize-resolved-combine
  • optimize_future_combinators
  • optimized_scheduler
  • restartable_reactor
  • running-while-stopping
  • ssl_support
  • ssl_support_on_1.2
  • stack-safe-after
  • stack-safe-reduce
  • streams
  • synchronized_close
  • thread-pooling
  • travis-test
  • travis_debug
  • try-complete-promise
  • unblock-once
  • uncaught-error-handler
  • v1.0.0
  • v1.1.0
  • v1.1.0.pre0
  • v1.1.1
  • v1.1.2
  • v1.1.3
  • v1.1.4
  • v1.1.5
  • v1.1.x
  • v1.2.0.pre0
  • v1.2.0.pre1
  • v1.2.0.pre2
  • v1.2.0.pre3
  • v1.2.0.pre4
  • v1.2.0.pre6
  • v1.2.0.pre7
  • v1.2.0.pre8
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.x
  • v1.3.0.pre0
  • v1.3.0.pre1
  • v1.3.0.pre2

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

Relevant lines Covered
Build:
Build:
2393 RELEVANT LINES 2389 COVERED LINES
9484.67 HITS PER LINE
Source Files on destructive-future-combinators
Detailed source file information is not available for this build.

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
164 destructive-future-combinators 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 ... push 11 Dec 2014 10:38PM UTC Gustav Munkby travis-ci pending completion  
See All Builds (272)
  • Repo 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