Skip to content

Commit 93771eb

Browse files
author
kristopher tate
committed
std/event/loop.zig: IRC exchange explaining commit; WIP;
1 parent ea88e7a commit 93771eb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

std/event/loop.zig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@ const os = std.os;
99
const posix = os.posix;
1010
const windows = os.windows;
1111

12+
// 06:52 <kristate> andrewrk: thinking about breaking-up the loop into separate
13+
// files for each platform. importing event.loop will import the correct
14+
// implementation for each OS and we will test the unified API in several test
15+
// blocks inside of event.loop -- there is just too much custom code between the
16+
// platforms and with threads, I want to make sure we get this right.
17+
// 06:53 <kristate> andrewrk: it's not as bad as you might imagine. only downside
18+
// is if we find a bug in one implementation, we will have to make sure to track
19+
// it down for each other files -- BUT, if we add the appropriate test case for
20+
// that bug, we should be able to run against all implementations and if the bug
21+
// does not show, then so be it
22+
// 06:54 <kristate> andrewrk: I think that this is going to be important as we go
23+
// forward -- defining the interface as tests in an index file, and then making
24+
// sure the tests pass in each implementation
25+
// 07:20 <andrewrk> kristate, I implemented the darwin file system stuff (not the
26+
// watching yet) in my async-fs branch
27+
// 07:20 <andrewrk> I went the other direction with it - not having different
28+
// files
29+
// 07:20 <kristate> andrewrk: yes, I see that -- but when we add FS watching in,
30+
// things will get messy with CFLoopRun
31+
// 07:20 <andrewrk> I think it's better to have the same function definitions and
32+
// types in one file, and that can switch out and import os-specific files if
33+
// necessary
34+
// 07:23 <andrewrk> kristate, I see, alright my mind is open to your way
35+
// 07:23 <andrewrk> sorry I gotta get some sleep, I'll be back in ~8 hours
36+
// 07:24 <kristate> okay, yeah -- please rest well. I will try to get something
37+
// hacked out with FS watch
38+
1239
pub use switch (builtin.os) {
1340
builtin.Os.linux => @import("loop/linux.zig"),
1441
builtin.Os.macosx => @import("loop/darwin.zig"),

0 commit comments

Comments
 (0)