sogou / workflow

C++ Parallel Computing and Asynchronous Networking Framework
Apache License 2.0
12.98k stars 2.4k forks source link
consul dag http kafka mysql redis sogou tasking

简体中文版(推荐)

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

We believe that a typical back-end program=protocol+algorithm+workflow and should be developed completely independently.

Basic task, task factory and complex task

Asynchrony and encapsulation based on C++11 std::function

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.