You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems like a minor issue with the design: Why can't the bindings just return false in this case (no copying), and true otherwise? Currently, the return type is void and this is done via webserver_has_event instead. Both of these can be merged.
The difference will likely be minor and I'd bet that LuaJIT can optimize this away, but removing a function would simplify the API.
TBD:
Is there ever a use case where you want to check that there are events in the buffer without fetching them afterwards?
Isn't webserver_get_event_count sufficient enough to check that there are events? Seems a bit redundant, if less clear
Since these are FFI bindings and not high-level APIs, simplifying the API surface should be more valuable than clarity of intent.
The text was updated successfully, but these errors were encountered:
The docs for
uws.webserver_get_next_event
state:This seems like a minor issue with the design: Why can't the bindings just return
false
in this case (no copying), andtrue
otherwise? Currently, the return type is void and this is done viawebserver_has_event
instead. Both of these can be merged.The difference will likely be minor and I'd bet that LuaJIT can optimize this away, but removing a function would simplify the API.
TBD:
webserver_get_event_count
sufficient enough to check that there are events? Seems a bit redundant, if less clearSince these are FFI bindings and not high-level APIs, simplifying the API surface should be more valuable than clarity of intent.
The text was updated successfully, but these errors were encountered: