Skip to content

Commit a0a832e

Browse files
committed
change the priorityQueue to specifically contain embedder.FlutterTask's
1 parent f28c639 commit a0a832e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

event-loop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (t *EventLoop) WaitForEvents(rendererWaitEvents func(float64)) {
100100

101101
// Fire expired tasks.
102102
for _, item := range expiredTasks {
103-
task := item.Value.(embedder.FlutterTask)
103+
task := item.Value
104104
if t.onExpiredTask(&task) != embedder.ResultSuccess {
105105
fmt.Printf("go-flutter: couldn't process task %v\n", task)
106106
}

internal/priorityqueue/priorityqueue.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ package priorityqueue
33
import (
44
"sync"
55
"time"
6+
7+
"github.com/go-flutter-desktop/go-flutter/embedder"
68
)
79

810
// An Item is something we manage in a priority queue.
911
type Item struct {
10-
Value interface{} // The value of the item; arbitrary.
11-
FireTime time.Time // The priority of the item in the queue.
12+
Value embedder.FlutterTask // The value of the item
13+
FireTime time.Time // The priority of the item in the queue.
1214

1315
// The index is needed by update and is maintained by the heap.Interface methods.
1416
index int // The index of the item in the heap.

0 commit comments

Comments
 (0)