Commit 30c4add 1 parent 9751a0a commit 30c4add Copy full SHA for 30c4add
File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ pub const Lock = @import("event/lock.zig").Lock;
4
4
pub const tcp = @import ("event/tcp.zig" );
5
5
pub const Channel = @import ("event/channel.zig" ).Channel ;
6
6
pub const Group = @import ("event/group.zig" ).Group ;
7
- pub const Future = @import ("event/future.zig" ).Group ;
7
+ pub const Future = @import ("event/future.zig" ).Future ;
8
8
9
9
test "import event tests" {
10
10
_ = @import ("event/locked.zig" );
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ test "std.event.Future" {
67
67
}
68
68
69
69
async fn testFuture (loop : * Loop ) void {
70
+ suspend | p | {
71
+ resume p ;
72
+ }
70
73
var future = Future (i32 ).init (loop );
71
74
72
75
const a = async waitOnFuture (& future ) catch @panic ("memory" );
@@ -79,10 +82,16 @@ async fn testFuture(loop: *Loop) void {
79
82
}
80
83
81
84
async fn waitOnFuture (future : * Future (i32 )) i32 {
85
+ suspend | p | {
86
+ resume p ;
87
+ }
82
88
return (await (async future .get () catch @panic ("memory" ))).* ;
83
89
}
84
90
85
91
async fn resolveFuture (future : * Future (i32 )) void {
92
+ suspend | p | {
93
+ resume p ;
94
+ }
86
95
future .data = 6 ;
87
96
future .resolve ();
88
97
}
You can’t perform that action at this time.
0 commit comments