Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
haskell-wasm
GHC
Commits
8a68407a
Commit
8a68407a
authored
1 month ago
by
Cheng Shao
Browse files
Options
Downloads
Patches
Plain Diff
docs: document the wasm backend promise.throwTo() feature
(cherry picked from commit
afdd3fe7
)
parent
fdf3d89c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/users_guide/wasm.rst
+11
-0
11 additions, 0 deletions
docs/users_guide/wasm.rst
with
11 additions
and
0 deletions
docs/users_guide/wasm.rst
+
11
−
0
View file @
8a68407a
...
...
@@ -715,3 +715,14 @@ JavaScript.
Finally, in JavaScript, you can use ``await __exports.my_func()`` to
call your exported ``my_func`` function and get its result, pass
arguments, do error handling, etc etc.
For each async export, the returned ``Promise`` value contains a
``promise.throwTo()`` callback. The value passed to
``promise.throwTo()`` will be wrapped as a ``JSException`` and raised
as an async exception in that thread. This can be useful for
interrupting Haskell computation in JavaScript. ``promise.throwTo()``
doesn't block the JavaScript caller like Haskell ``throwTo``. It
doesn't necessarily result in ``promise`` being rejected since the
Haskell thread can handle the async exception, and it can be called
multiple time. It has no effect when the respective Haskell thread has
already run to completion.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment