Skip to content

feat: new api interfaceSetResponseFileHandler#78

Merged
jinzhongjia merged 2 commits intomainfrom
new-api
Feb 2, 2025
Merged

feat: new api interfaceSetResponseFileHandler#78
jinzhongjia merged 2 commits intomainfrom
new-api

Conversation

@jinzhongjia
Copy link
Member

No description provided.

@jinzhongjia jinzhongjia merged commit f605542 into main Feb 2, 2025
20 checks passed
@AlbertShown
Copy link
Member

I don't know if Zig has async operations, but if you need it this is how it works:

  1. Zig set setConfig(asynchronous_response, true) = Means WebUI will wait for xxx_set_response_xxx()
  2. WebUI calls a user callback function (Event, FileHandler...)
  3. Callback function return right away with empty response (async operation)
  4. WebUI detect asynchronous_response is true, so WebUI wait for callback function response...
  5. Callback function do some work...
  6. Callback function finish, then return a response to Zig
  7. Zig calls xxx_set_response_xxx()
  8. WebUI sends the response to UI (web browser)
  9. Done.

@jinzhongjia
Copy link
Member Author

At present Zig’s Async is frozen and cannot be used

@AlbertShown
Copy link
Member

Okay, in the future, when Zig fully implement async, we can add it to the Zig wrapper as WebUI is already fully supporting async.

@jinzhongjia jinzhongjia deleted the new-api branch March 3, 2025 09:02
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.

2 participants