Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Composite.execute cannot be called multiple times in the same mojit #1280

Closed
aljimenez opened this issue Nov 1, 2013 · 3 comments
Closed

Comments

@aljimenez
Copy link
Contributor

The following use of composite.execute results in a crash since the Y.Parallel queue that is used internally is not cleared after execution is done.

ac.composite.execute(config, function (data, meta) {
    ac.composite.execute(newConfig, function (data2, meta2) {
        ...
    });
});

There are many valid use cases for this. In my case I would like to execute a mojit which then accumulates some data, which I then need to execute other mojits. One easy fix in composite.common.js would be to reset the Y.Parallel queue before calling the callback towards the end of the execute method. That way subsequent executions would use a new queue:

self.queue = new Y.Parallel({
    context: self
});

cb(content, meta);
@drewfish
Copy link
Contributor

drewfish commented Nov 4, 2013

It seems reasonable to me to want to use ac.composite.execute() multiple times like you suggest.

@caridy
Copy link
Contributor

caridy commented Nov 12, 2013

/ping @lzhan

lzhan pushed a commit to lzhan/mojito that referenced this issue Nov 27, 2013
lzhan pushed a commit that referenced this issue Dec 18, 2013
fix issue #1280 Composite.execute cannot be called multiple times in the...
lzhan pushed a commit to lzhan/mojito that referenced this issue Dec 27, 2013
@clarle
Copy link

clarle commented Jan 15, 2014

Issue resolved in #1300, and released in 0.8.2.

Thanks for the report @aljimenez!

@clarle clarle closed this as completed Jan 15, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants