[concurrency-interest] How to subclass CompletableFuture?

Kasper Nielsen kasperni at gmail.com
Mon Oct 27 01:44:41 EDT 2014


I've found CompletableFuture impossible to extend. Mainly because all the
methods returns new instances of CompletableFuture. Where you probably want
to return new instances of your CompletableFutureSubClass.

So I think the proper way is using composition. However with all the
methods in CompletableStage it takes some determination.

- Kasper


On Mon, Oct 27, 2014 at 3:21 AM, cowwoc <cowwoc at bbs.darktech.org> wrote:

> Hi,
>
> I believe that CompletableFuture was designed to allow for subclassing but
> I
> can't seem to figure out how to implement such a subclass:
> http://stackoverflow.com/q/26579139/14731
>
> I figured if anyone would know how to implement this kind of thing, it
> would
> be you :)
>
> Thanks,
> Gili
>
>
>
> --
> View this message in context:
> http://jsr166-concurrency.10961.n7.nabble.com/How-to-subclass-CompletableFuture-tp11382.html
> Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20141027/b50533b7/attachment.html>


More information about the Concurrency-interest mailing list