-
Notifications
You must be signed in to change notification settings - Fork 1
no async #11
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
base: master
Are you sure you want to change the base?
no async #11
Conversation
|
Here's a live demo In text form: |
|
Thanks! It will take me a bit to better understand the proposed changes. How difficult would it be to add support for using PostMessage as an alternative to callbacks to avoid the AutoIt quirks? I'm thinking that at minimum I'd need to store an additional hWnd and an Msg ID for each connection. |
That seems like the wrong question. The question is "is hacking using windows messages a suitable workaround". My take on this is a firm "don't go there". Instead, lobby AutoIt to add support for async events/callbacks. Or make your own interface usable in non-async fashion. |
Understood, but Windows messaging appears to be a workable alternative given the limitations I've encountered.
Already done. However, the issue has been around for over 8 years, so I'm not holding my breath. 🙄
Would I still be able to receive messages event-driven? |
Not on the script side. You're free to implement the websocket part in whatever way (like now |

Here's my edit on top of g9c3476 to show the interface as sketched in the synopsis on #9
I did NOT adapt the AHK/AutoIt scripts as I don't know enough about those script languages. However, you can probably trivially adapt, like I did in https://github.com/Danp2/WebSocketAsio/pull/11/files#diff-0279b7052b5595cd1c9558eb9a7f57a92f4b7d22dc75a53a3536ae6ec9879863R53
Note how making the end-user interface largely synchronous does not imply using synchronous implementation. In fact, as long as you want asynchronous closing/read operation you cannot because sync and async don't mix
Since you seemed to have hinted that AutoIt simply cannot afford async callbacks without undefined behavior, I'd consider moving to a fully sync approach. But I cannot judge whether (a) this suits your needs (b) what you would like the interface to look like.