Webtorrent-desktop: Choose between promise style or sync style when interacting with electron

Created on 12 Dec 2019  Â·  3Comments  Â·  Source: webtorrent/webtorrent-desktop

After fixing some electron@7 bugs related to the deprecation of callback based version of functions, @alxhotel correctly bring the question of choosing to go full promise style or sync style when interacting with electron.

I created this issue so we can discus about it 😉

My opinion is to use sync style unless there is any drawback (performance, ...) 😅

What do you think?

question

All 3 comments

Synchronous seems cleaner to avoid callback hell / unnecessary promise complexity.

For UI interactions, my hunch is there shouldn’t be any detectable performance implications since it’s all bottlenecked by user interactions.

If we're blocking to show a dialog to the user then using sync functions in the renderer seems fine!

(As long as we don't block in the webtorrent renderer – which would then cause all webtorrent work to stall.)

Closing this issue, as I think we have consensus here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DiegoRBaquero picture DiegoRBaquero  Â·  6Comments

npyl picture npyl  Â·  4Comments

shauryasehgal picture shauryasehgal  Â·  5Comments

barcazama picture barcazama  Â·  3Comments

adatum picture adatum  Â·  3Comments