Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qbar
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
Container Registry
Model registry
Operate
Environments
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
qbar
Commits
b3c86028
Commit
b3c86028
authored
5 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Rename UserUpdate to EventUpdate
parent
7f32e700
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/QBar/BlockHelper.hs
+4
-4
4 additions, 4 deletions
src/QBar/BlockHelper.hs
src/QBar/Core.hs
+1
-1
1 addition, 1 deletion
src/QBar/Core.hs
src/QBar/Host.hs
+3
-3
3 additions, 3 deletions
src/QBar/Host.hs
with
8 additions
and
8 deletions
src/QBar/BlockHelper.hs
+
4
−
4
View file @
b3c86028
...
...
@@ -154,7 +154,7 @@ runSignalBlockConfiguration SignalBlockConfiguration{initialize, signalThread, s
case
signal
of
EventSignal
_
->
do
(
state
,
_
)
<-
get
lift
$
yield
(
invalidateBlockState
state
,
User
Update
)
lift
$
yield
(
invalidateBlockState
state
,
Event
Update
)
_
->
return
()
outputAndStore
signal
void
$
sendQueuedEvents
...
...
@@ -170,7 +170,7 @@ runSignalBlockConfiguration SignalBlockConfiguration{initialize, signalThread, s
signalToReason
::
Signal
a
->
BlockUpdateReason
signalToReason
(
UserSignal
_
)
=
DefaultUpdate
signalToReason
(
EventSignal
_
)
=
User
Update
signalToReason
(
EventSignal
_
)
=
Event
Update
signalToReason
RegularSignal
=
PollUpdate
...
...
@@ -210,7 +210,7 @@ runPollBlock' interval pb = do
maybeOutput
<-
await
-- Attach a click handler that will trigger a block update
let
state
=
mkBlockStateWithHandler
(
triggerOnClick
event
)
maybeOutput
yield
(
state
,
if
isEvent
then
User
Update
else
PollUpdate
)
yield
(
state
,
if
isEvent
then
Event
Update
else
PollUpdate
)
scheduler
<-
askSleepScheduler
result
<-
liftIO
$
do
...
...
@@ -222,7 +222,7 @@ runPollBlock' interval pb = do
when
isEventNew
$
do
liftIO
$
Event
.
clear
event
yield
(
invalidateBlockState
state
,
User
Update
)
yield
(
invalidateBlockState
state
,
Event
Update
)
sleepToNextInterval'
isEventNew
...
...
This diff is collapsed.
Click to expand it.
src/QBar/Core.hs
+
1
−
1
View file @
b3c86028
...
...
@@ -43,7 +43,7 @@ data ExitBlock = ExitBlock
type
BlockEventHandler
=
BlockEvent
->
BarIO
()
type
BlockState
=
Maybe
(
BlockOutput
,
Maybe
BlockEventHandler
)
data
BlockUpdateReason
=
DefaultUpdate
|
PollUpdate
|
User
Update
data
BlockUpdateReason
=
DefaultUpdate
|
PollUpdate
|
Event
Update
type
BlockUpdate
=
(
BlockState
,
BlockUpdateReason
)
-- |Block that 'yield's an update whenever the block should be changed
...
...
This diff is collapsed.
Click to expand it.
src/QBar/Host.hs
+
3
−
3
View file @
b3c86028
...
...
@@ -140,8 +140,8 @@ filterDuplicates = do
followupEventWaitTime
::
BlockUpdateReason
->
Int
followupEventWaitTime
DefaultUpdate
=
10000
followupEventWaitTime
PollUpdate
=
50000
-- 'followupEventWaitTime' for '
User
Update' has to be zero, or blocks would be blocked blocked for this time when sending a 'UserUpdate'.
followupEventWaitTime
User
Update
=
0
-- 'followupEventWaitTime' for '
Event
Update' has to be zero, or blocks would be blocked blocked for this time when sending a 'UserUpdate'.
followupEventWaitTime
Event
Update
=
0
followupEventWaitTimeDefault
::
Int
followupEventWaitTimeDefault
=
followupEventWaitTime
PollUpdate
...
...
@@ -153,7 +153,7 @@ requestBarUpdateHandler HostHandle{barUpdateEvent, barUpdatedEvent, followupEven
signalHost
blockUpdateReason
where
signalHost
::
BlockUpdateReason
->
IO
()
signalHost
User
Update
=
do
signalHost
Event
Update
=
do
-- Start waiting before triggering the event cannot be missed
task
<-
async
$
Event
.
wait
barUpdatedEvent
Event
.
set
barUpdateEvent
...
...
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