# add event loop Channel abstraction · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/a3f55aaf34f0a459c8aec4b35e55ad4534eaca30)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: a3f55aaf34f0a459c8aec4b35e55ad4534eaca30

Requested commit: a3f55aaf34f0a459c8aec4b35e55ad4534eaca30

Commit: a3f55aaf34f0a459c8aec4b35e55ad4534eaca30

Tree: 5799189e210d53271de654a2f713e7d5f9056fed

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
add event loop Channel abstraction

This is akin to channels in Go, except:
 * implemented in userland
 * they are lock-free and thread-safe
 * they integrate with the userland event loop

The self hosted compiler is changed to use a channel for events,
and made to stay alive, watching files and performing builds when
things change, however the main.zig file exits after 1 build.

Note that nothing is actually built yet, it just parses the input
and then declares that the build succeeded.

Next items to do:
 * add windows and macos support for std.event.Loop
 * improve the event loop stop() operation
 * make the event loop multiplex coroutines onto kernel threads
 * watch source file for updates, and provide AST diffs
   (at least list the top level declaration changes)
 * top level declaration analysis

```

## Parents

- [2759c7951da050d825cf765c4b660f5562fb01a4](https://git.cafe/gitcafe/zig/commit/2759c7951da050d825cf765c4b660f5562fb01a4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/a3f55aaf34f0a459c8aec4b35e55ad4534eaca30?format=markdown)
