dagger-producers - parallelizable execution graphs

117 views
Skip to first unread message

Derek Baum

unread,
Jan 4, 2016, 3:23:02 PM1/4/16
to Dagger Discuss
I am interested in creating execution graphs in parallel, which seems to be possible using @ProductionComponent and other annotations in dagger.producers (which are marked @Beta).

I can't find any mention of this or examples in the dagger2 documentation or elsewhere.

Does anyone have any experience or links to other documents about using dagger.producers?

Thanks,

--
Derek


Derek Baum

unread,
Jan 22, 2016, 12:49:08 PM1/22/16
to Dagger Discuss
I didn't find any other information about using dagger.producers to create execution graphs in parallel, so I have experimented myself.

I've copied the dagger 'simple' coffee example and changed it so that the Pump and Grinder are created in parallel.

The output now looks like this:

@Provide Heater
@Inject Thermosiphon
@Producing Pump..
@Producing Grinder..
done @Producing Grinder
done @Producing Pump
@Producing CoffeeMaker..

I had a few problems with the generated code not compiling due to some mismatch with Futures.transformAsync() and the maven compile still fails.
But I was able run it in Eclipse all the same.

You can find the code here:



--
Derek
Reply all
Reply to author
Forward
0 new messages