Giter Club home page Giter Club logo

pike's Introduction

pike

A minimal cross-platform high-performance async I/O library written in Zig.

Features

  • Reactor/proactor-based I/O notification support
    • epoll (linux)
    • kqueue (darwin)
    • i/o completion ports (windows)
  • Async POSIX socket support
    • bind, listen, connect, accept
    • read, recv, recvFrom
    • write, send, sendTo
    • get/set socket options
  • Async Windows socket support
    • bind, listen, connect, accept
    • read, recv, recvFrom
    • write, send, sendTo
    • get/set socket options
  • Async signal support
    • signalfd for epoll (linux)
    • EVFILT_SIGNAL for kqueue (darwin)
    • SetConsoleCtrlHandler for i/o completion ports (windows)
  • Async event support
    • sigaction (posix)
    • SetConsoleCtrlHandler (windows)

Design

Notifier

A Notifier notifies of the completion of I/O events, or of the read/write-readiness of registered file descriptors/handles.

Should a Notifier report the completion of I/O events, it is designated to wrap around a proactor-based I/O notification layer in the operating system such as I/O completion ports on Windows.

Should a Notifier report the read/write-readiness of registered file descriptors/handles, it is designated to wrap around a reactor-based I/O notification layer in the operating system such as epoll on Linux, or kqueue on Darwin-based operating systems.

The Notifier's purpose is to drive the execution of asynchronous I/O syscalls upon the notification of a reactor/proactor-based I/O event by dispatching suspended asynchronous function frames to be resumed by a thread pool/scheduler (e.g. kprotty/zap).

Handle

A Handle's implementation is specific to a Notifier implementation, though overall wraps around and represents a file descriptor/handle in a program.

Subject to the Notifier implementation a Handle's implementation falls under, state required to drive asynchronous I/O syscalls through a Handle is kept inside a Handle.

An example would be an intrusive linked list of suspended asynchronous function frames that are to be resumed upon the recipient of a notification that a file descriptor/handle is ready to be written to/read from.

pike's People

Contributors

lithdew avatar nektro avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.