Skip to content

websockets #71

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

Merged
merged 6 commits into from
Feb 16, 2022
Merged

websockets #71

merged 6 commits into from
Feb 16, 2022

Conversation

guzba
Copy link
Collaborator

@guzba guzba commented Feb 16, 2022

No description provided.

@levovix0
Copy link
Contributor

Why use winapi to do http requests, when there is std/httpclient and std/asyncnet?

@guzba
Copy link
Collaborator Author

guzba commented Feb 16, 2022

Many reasons:

  1. -d:ssl
  2. Requires shipping cacerts.pem with any app on Windows
  3. Requires shipping extra dls with any apps on Windows

More info here I think to start: https://forum.nim-lang.org/t/7551

Also requires having the main thread spend time in OS network poll stuff which wastes time for games, etc: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncdispatch.nim#L1649

Further, async's await just doesn't feel good at all in client apps IMO. For example, I do not like the await + exceptions model for requests and handling errors. Worst possible combo.

We'll probably fall back to Nim's stuff for Linux but on Mac and Windows the OS has better options for client apps.

And don't forget inflicting {.async.} everywhere. https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/

@treeform treeform merged commit b2a0f39 into treeform:master Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants