Skip to content

Commit af5a58a

Browse files
committed
loop: remove Yield impl
1 parent 4580871 commit af5a58a

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

src/loop.zig

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -207,44 +207,6 @@ pub const SingleThreaded = struct {
207207
}
208208
}
209209

210-
// Yield
211-
pub fn Yield(comptime Ctx: type) type {
212-
// TODO check ctx interface funcs:
213-
// - onYield(ctx: *Ctx, ?anyerror) void
214-
return struct {
215-
const YieldImpl = @This();
216-
const Loop = Self;
217-
218-
loop: *Loop,
219-
ctx: *Ctx,
220-
completion: IO.Completion,
221-
222-
pub fn init(loop: *Loop) YieldImpl {
223-
return .{
224-
.loop = loop,
225-
.completion = undefined,
226-
.ctx = undefined,
227-
};
228-
}
229-
230-
pub fn tick(self: *YieldImpl) !void {
231-
return try self.loop.io.tick();
232-
}
233-
234-
pub fn yield(self: *YieldImpl, ctx: *Ctx) void {
235-
self.ctx = ctx;
236-
_ = self.loop.addEvent();
237-
self.loop.io.timeout(*YieldImpl, self, YieldImpl.yieldCbk, &self.completion, 0);
238-
}
239-
240-
fn yieldCbk(self: *YieldImpl, _: *IO.Completion, result: IO.TimeoutError!void) void {
241-
_ = self.loop.removeEvent();
242-
_ = result catch |err| return self.ctx.onYield(err);
243-
return self.ctx.onYield(null);
244-
}
245-
};
246-
}
247-
248210
// Network
249211
pub fn Network(comptime Ctx: type) type {
250212

0 commit comments

Comments
 (0)