workflow README

The project's README from github.com/sogou/workflow. As one markdown file: README.md.

简体中文版(推荐)

Sogou C++ Workflow

License Language Platform Build Status

As Sogou`s C++ server engine, Sogou C++ Workflow supports almost all back-end C++ online services of Sogou, including all search services, cloud input method, online advertisements, etc., handling more than 10 billion requests every day. This is an enterprise-level programming engine in light and elegant design which can satisfy most C++ back-end development requirements.

You can use it:

#include <stdio.h>
#include "workflow/WFHttpServer.h"

int main()
{
    WFHttpServer server([](WFHttpTask *task) {
        task->get_resp()->append_output_body("<html>Hello World!</html>");
    });

    if (server.start(8888) == 0) { // start server on port 8888
        getchar(); // press "Enter" to end.
        server.stop();
    }

    return 0;
}

Compiling and Running Environment

Get Started (Linux, macOS):

git clone https://github.com/sogou/workflow
cd workflow
make
cd tutorial
make

With SRPC Tool (NEW!):

https://github.com/sogou/srpc/blob/master/tools/README.md

With apt-get on Debian Linux, ubuntu:

Sogou C++ Workflow has been packaged for Debian Linux and ubuntu 22.04.
To install the Workflow library for development purposes:

sudo apt-get install libworkflow-dev

To install the Workflow library for deployment:

sudo apt-get install libworkflow1

With dnf on Fedora Linux:

Sogou C++ Workflow has been packaged for Fedora Linux.
To install the Workflow library for development purposes:

sudo dnf install workflow-devel

To install the Workflow library for deployment:

sudo dnf install workflow

With xmake

If you want to use xmake to build workflow, you can see xmake build document

Tutorials

Programming Paradigm

Program = Protocol + Algorithm + Workflow

Structured Concurrency and Task Abstraction

Callback and Memory Reclamation Mechanism

Any Other Questions?

You may check the FAQ and issues list first to see if you can find the answer.

You are very welcome to send the problems you encounter in use to issues, and we will answer them as soon as possible. At the same time, more issues will also help new users.

workflow (sogou/workflow)

Searching Database…

14.4K ·GitHub
这是什么?Sogou C++ Workflow 是一个企业级 C++ 引擎,用于异步网络和并行计算。搜狗内部用它支撑搜索、云输入法和广告服务,每天处理数十亿次请求。
它是框架,还是只是一个网络库?它是一个完整的异步编程框架:它既是支持多种协议的客户端/服务端库(HTTP、Redis、MySQL、Kafka),也允许你构建自定义协议、自己的 RPC 系统,以及任意基于 DAG 的工作流,把网络通信和计算结合起来。
我该怎么把它加到我的项目里?在 Debian/Ubuntu 上用 apt-get 或在 Fedora 上用 dnf 安装预编译包,用 xmake 构建,或用 make 从源码编译;然后按照教程(例如 'wget' 客户端示例)编写你的第一个任务。
编译它需要什么?需要支持 C++11 的编译器和 OpenSSL 1.1+(BoringSSL 也可以);它不依赖 boost 或 asio,但 Kafka 协议需要 lz4、zstd 和 snappy 压缩库。
Windows 版本和 Linux 版本功能一样吗?Windows 支持以独立分支的形式提供,使用 IOCP 而不是基于 Linux epoll 的实现,不过面向用户的接口与 Linux 版本保持一致。
它能在哪些平台和 CPU 上运行?它可运行于 Linux、macOS、Windows 和 Android,支持 32 位和 64 位 x86、大端和小端 ARM 架构,以及龙芯处理器。
Workflow 和 srpc 是什么关系?srpc 是基于 Workflow 构建的独立开源 RPC 系统,额外支持 srpc、brpc、trpc 和 thrift 协议。
工作流能不能比简单的串行/并行链更复杂?可以。除了常见的串行和并行结构,该框架还支持任意 DAG(有向无环图)任务拓扑。
开箱即用自带哪些客户端?它内置了现成的异步客户端,支持 HTTP、Redis、MySQL(以及 MariaDB、TiDB)和 Kafka,因此这些协议无需你自己编写协议代码。
异步回调代码里,它怎么避免内存泄漏?每个任务的生命周期从创建一直持续到回调执行完毕,之后会自动回收;不需要的任务必须通过 dismiss() 释放。设计上特意避免使用 std::shared_ptr,而采用基于 std::function 的回调。
What are similar projects?brpc, consul, swoole-src, pingora, go-zero, istio, zenc, eureka
Creator
sogou
Size
5 MB
Stars
14.4K
Age
6y
Commits · 90 Days