Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
quasar
Commits
b519b8a8
Commit
b519b8a8
authored
2 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Rename forkAsync to forkFuture
parent
08944b88
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Quasar/Async/Fork.hs
+8
-8
8 additions, 8 deletions
src/Quasar/Async/Fork.hs
src/Quasar/Resources.hs
+1
-1
1 addition, 1 deletion
src/Quasar/Resources.hs
with
9 additions
and
9 deletions
src/Quasar/Async/Fork.hs
+
8
−
8
View file @
b519b8a8
...
...
@@ -4,8 +4,8 @@ module Quasar.Async.Fork (
-- ** IO
forkWithUnmask
,
forkWithUnmask_
,
fork
Async
,
fork
Async
WithUnmask
,
fork
Future
,
fork
Future
WithUnmask
,
-- ** STM
forkSTM
,
...
...
@@ -44,11 +44,11 @@ forkWithUnmaskSTM_ fn worker exChan = void $ forkWithUnmaskSTM fn worker exChan
forkAsyncSTM
::
forall
a
.
IO
a
->
TIOWorker
->
ExceptionSink
->
STM
(
Future
a
)
-- TODO change TIOWorker behavior for spawning threads, so no `unsafeShortIO` is necessary
forkAsyncSTM
fn
worker
exChan
=
join
<$>
startShortIOSTM
(
unsafeShortIO
$
fork
Async
fn
exChan
)
worker
exChan
forkAsyncSTM
fn
worker
exChan
=
join
<$>
startShortIOSTM
(
unsafeShortIO
$
fork
Future
fn
exChan
)
worker
exChan
forkAsyncWithUnmaskSTM
::
forall
a
.
((
forall
b
.
IO
b
->
IO
b
)
->
IO
a
)
->
TIOWorker
->
ExceptionSink
->
STM
(
Future
a
)
-- TODO change TIOWorker behavior for spawning threads, so no `unsafeShortIO` is necessary
forkAsyncWithUnmaskSTM
fn
worker
exChan
=
join
<$>
startShortIOSTM
(
unsafeShortIO
$
fork
Async
WithUnmask
fn
exChan
)
worker
exChan
forkAsyncWithUnmaskSTM
fn
worker
exChan
=
join
<$>
startShortIOSTM
(
unsafeShortIO
$
fork
Future
WithUnmask
fn
exChan
)
worker
exChan
-- * Fork in IO, redirecting errors to an ExceptionSink
...
...
@@ -65,11 +65,11 @@ forkWithUnmask_ fn exChan = void $ forkWithUnmask fn exChan
-- * Fork in IO while collecting the result, redirecting errors to an ExceptionSink
fork
Async
::
forall
a
.
IO
a
->
ExceptionSink
->
IO
(
Future
a
)
fork
Async
fn
=
fork
Async
WithUnmask
(
$
fn
)
fork
Future
::
forall
a
.
IO
a
->
ExceptionSink
->
IO
(
Future
a
)
fork
Future
fn
=
fork
Future
WithUnmask
(
$
fn
)
fork
Async
WithUnmask
::
forall
a
.
((
forall
b
.
IO
b
->
IO
b
)
->
IO
a
)
->
ExceptionSink
->
IO
(
Future
a
)
fork
Async
WithUnmask
fn
exChan
=
do
fork
Future
WithUnmask
::
forall
a
.
((
forall
b
.
IO
b
->
IO
b
)
->
IO
a
)
->
ExceptionSink
->
IO
(
Future
a
)
fork
Future
WithUnmask
fn
exChan
=
do
resultVar
<-
newPromise
forkWithUnmask_
(
runAndPut
resultVar
)
exChan
pure
$
toFuture
resultVar
...
...
This diff is collapsed.
Click to expand it.
src/Quasar/Resources.hs
+
1
−
1
View file @
b519b8a8
...
...
@@ -49,7 +49,7 @@ import Quasar.Utils.ShortIO
newUnmanagedIODisposer
::
IO
()
->
TIOWorker
->
ExceptionSink
->
STM
Disposer
-- TODO change TIOWorker behavior for spawning threads, so no `unsafeShortIO` is necessary
newUnmanagedIODisposer
fn
worker
exChan
=
newUnmanagedPrimitiveDisposer
(
unsafeShortIO
$
fork
Async
fn
exChan
)
worker
exChan
newUnmanagedIODisposer
fn
worker
exChan
=
newUnmanagedPrimitiveDisposer
(
unsafeShortIO
$
fork
Future
fn
exChan
)
worker
exChan
newUnmanagedSTMDisposer
::
STM
()
->
TIOWorker
->
ExceptionSink
->
STM
Disposer
newUnmanagedSTMDisposer
fn
worker
exChan
=
newUnmanagedPrimitiveDisposer
disposeFn
worker
exChan
...
...
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