explaingit

sylar-yin/sylar

4,655C++Audience · developerComplexity · 5/5Setup · hard

TLDR

Sylar is a C++ server framework built for high-performance networked apps, using coroutines to handle thousands of connections efficiently, created as a tutorial series for learners building from scratch.

Mindmap

mindmap
  root((sylar))
    What it does
      HTTP server
      WebSocket server
      Coroutine scheduling
    Tech stack
      C++
      epoll Linux
      YAML config
      MySQL SQLite Redis
    Use cases
      High-perf servers
      Async networking
      Learning C++ servers
    Modules
      Logging
      Config
      IO scheduler
      Hook system
    Databases
      MySQL
      SQLite3
      Redis
      Zookeeper
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a high-performance HTTP or WebSocket server in C++ using the coroutine-based IO scheduler.

USE CASE 2

Use the hook module to make blocking third-party libraries like MySQL clients work in an async coroutine environment.

USE CASE 3

Learn how to build a server framework from scratch by following the companion Bilibili tutorial series.

USE CASE 4

Set up YAML-based configuration that automatically notifies your app components when settings change.

Tech stack

C++Linux epollYAMLMySQLSQLite3RedisZookeeper

Getting it running

Difficulty · hard Time to first run · 1day+

Linux-only due to epoll dependency, requires C++ build toolchain and familiarity with Chinese-language documentation.

License not clearly stated in README, check the repository for details before using commercially.

In plain English

Sylar is a C++ framework for building high-performance networked server applications, including web servers and WebSocket servers. It was created alongside a Chinese-language video tutorial series on Bilibili aimed at teaching people how to build a server framework from scratch. The README is written in Chinese. The framework is organized into a collection of modules that each handle a specific concern. The logging module supports two styles of writing log messages, lets you customize the log format, set log levels, and route different logs to different destinations. The configuration module reads settings from YAML files and automatically notifies parts of the application when a setting changes, so you do not need to manually reload values. At its core, the framework uses coroutines, which are a way to write code that looks sequential but can pause and resume to handle multiple tasks at once without the overhead of creating many operating system threads. The coroutine scheduler manages groups of coroutines across a configurable pool of threads. Built on top of that, the IO coroutine scheduler uses Linux's epoll system to handle network reads and writes efficiently, and it also provides timers with millisecond precision. A hook module intercepts low-level socket and sleep system calls so that libraries or code that was not written for async use (like MySQL client libraries) can still benefit from the coroutine-based async model without any changes to that code. The framework includes modules for TCP servers, HTTP/1.1 parsing and serving, WebSocket, HTTPS, a servlet system modeled after Java's servlet pattern, binary serialization, and support for MySQL, SQLite3, Redis, Zookeeper, and a basic ORM layer. Contact information for the author, including a QQ number and personal website, is listed at the bottom of the README.

Copy-paste prompts

Prompt 1
Show me how to create a basic HTTP server using the sylar C++ framework with its coroutine scheduler.
Prompt 2
How do I use sylar's hook module to make a blocking MySQL client work in an async context?
Prompt 3
Walk me through setting up sylar's logging system with custom log levels and routing logs to a file.
Prompt 4
How do I configure sylar's IO coroutine scheduler with a thread pool size of 4 threads using epoll?
Open on GitHub → Explain another repo

← sylar-yin on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.