Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-throttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-throttle
Commits
ae3cb7d5
Verified
Commit
ae3cb7d5
authored
Jul 27, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update throttle comment
parent
09069891
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Throttle.hs
src/Control/Concurrent/Throttle.hs
+7
-1
No files found.
src/Control/Concurrent/Throttle.hs
View file @
ae3cb7d5
...
...
@@ -34,7 +34,13 @@ action only as frequently as allowed and other calls are DROPPED. This
is in contrast to things like Conduit throttling, where actions are
just SLOWED DOWN. We use this for asynchronous notifications and, if
messages are the same, we can just drop them safely. Our input is the
provided 'TChan.TChan'. This function should be spawned as a thread.
provided 'TChan.TChan'.
This function should be spawned as a thread.
We provide separate 'id' and 'a'. 'id' is used for uniquely
identifying groups of throttled messages, while 'a' are actual
messages that are sent to 'action' callback.
-}
throttle
::
(
Ord
id
,
Eq
id
,
Show
id
)
=>
Int
->
TChan
.
TChan
(
id
,
a
)
->
(
a
->
IO
()
)
->
IO
()
throttle
delay
tchan
action
=
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment