New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synchronous vs Asynchronous #566
Comments
@ziluvatar , @MitMaro can you help me? |
Hello??????????? |
:-(( |
https://medium.com/@patrykcieszkowski/jwt-authentication-in-express-js-ee898b87a60 section Verifying the Token may help you |
@wjureczkaPracuj as I understand, in point of performance there is no different I use sync or async mode, and it is safe to use sync mode in server too |
Correct. Although if you use the sync way be sure you wrap it with try-catch. |
If there is no perf difference, why does the library offer an async alternative? |
TL;DR; To allow consumers load keys from filesystem or any other source of ReadStream without blocking event loop. Not to actually perform the signing. I've been digging into git history and jws implementation to understand why the library provided the async functionality for signing:
Honestly, not sure if that streaming is a desired feature by consumers, we'd need to update the README to make it clear. |
@ziluvatar That sounds like some serious coding archaeology... well done! 😉 |
Synchronous
Asynchronous
I want to know , is it bad to use Synchronous way , in express js server? is there any benefit with Asynchronous mode? As I think there is no I/O and just CPU usage, So Asynchronous and Synchronous must b same, just syntax is different
The text was updated successfully, but these errors were encountered: