Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Investigate: long stack traces support #57

Open
getify opened this issue Nov 14, 2014 · 14 comments
Open

Investigate: long stack traces support #57

getify opened this issue Nov 14, 2014 · 14 comments
Assignees

Comments

@getify
Copy link
Owner

getify commented Nov 14, 2014

No description provided.

@getify getify self-assigned this Nov 14, 2014
@legodude17
Copy link

Why do you mean by long stack traces?

@getify
Copy link
Owner Author

getify commented Jul 28, 2016

check out bluebird's "long stack traces". It has to do with being able to trace/inspect the entire async stack of operations that preceded an error.

@legodude17
Copy link

Ah, so something like what bluebird does, just put into asynquence.

On Thu, Jul 28, 2016 at 7:09 AM, Kyle Simpson notifications@github.com
wrote:

check out bluebird's "long stack traces". It has to do with being able to
trace/inspect the entire async stack of operations that preceded an error.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#57 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKr56KXTk5igMlFyv1kfzrdzy0rMhs_hks5qaLg2gaJpZM4C6-yA
.

@legodude17
Copy link

Early investigation shows that bluebird and when do this, and it would be at least 150 lines, probably around 250 - 300.

@getify
Copy link
Owner Author

getify commented Jul 31, 2016

Thank you for the estimates. I am partially concerned about "cost" (file size, perf) and partially concerned about the best way to configure it (per chain) -- default on or off? -- and also concerned about the best way to make the stack trace available. lots to think about.

@legodude17
Copy link

The cost is quite big. One way is to have it on according to environment variables. You could also add a ASQ.config function.

@getify
Copy link
Owner Author

getify commented Jul 31, 2016

Want this to work in browser too. So no on env vars. Should also investigate if there are other things that should be configurable per instance and if so, make sure we expose this config consistently.

@legodude17
Copy link

I now think the best way to do this would be to just provide a platform so that a monitor and reporter can be built in separate files. This will also allow people to make thier own monitoring functionality. This is what when does.

@getify
Copy link
Owner Author

getify commented Jul 31, 2016

Do you have any links to read more about this?

@getify
Copy link
Owner Author

getify commented Jul 31, 2016

Perhaps a way to specify a listener on a sequence that is notified for each step, so someone else could hook into that from the outside and listen to an entire sequence, whether it's error or not.

@legodude17
Copy link

legodude17 commented Jul 31, 2016

I got this from reading when's code. Relevant files:

The main limit to doing this as a plugin is that plugins can't listen for events. Maybe we could add that?

@legodude17
Copy link

Basics are done now:
Output without long trace:

Error: Ahhh!
    at Timeout.$$timeout [as _onTimeout] (/home/jdb/Desktop/Code/ASQDev/asynquence/test-long-trace.js:9:45)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)

Output with lone trace:

Error: Ahhh!
    at Timeout.$$timeout [as _onTimeout] (/home/jdb/Desktop/Code/ASQDev/asynquence/test-long-trace.js:9:45)
    at Object.<anonymous> (/home/jdb/Desktop/Code/ASQDev/asynquence/test-long-trace.js:5:1)

With this code:

var ASQ = require("./contrib/contrib.src.js");
try { ASQ.messages(); } catch (err) {
    ASQ = ASQ( require("./asq.src.js") );
}
ASQ().then(function $$handle(done) {
    setTimeout(function () {ASQ().then(handle).pipe(done); }, 100);
});
function handle(done) {
    setTimeout(function $$timeout() {done.fail(new Error('Ahhh!'))}, 100);
}

@legodude17
Copy link

The method to do this adds 27 unminified lines to asq.src.js and adds a 153 line plugin in contrib.

@legodude17
Copy link

legodude17 commented Aug 9, 2016

Full fork is here

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

2 participants