Merge branch 'master' of https://github.com/sogou/workflow into dev

This commit is contained in:
XieHan
2021-01-13 20:03:00 +08:00
5 changed files with 32 additions and 17 deletions
+21
View File
@@ -0,0 +1,21 @@
language: cpp
dist: trusty
os: linux
compiler:
- gcc
jobs:
include:
- env: COMPILER=g++-8 BUILD=Release STANDARD=11
compiler: gcc
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
packages:
- g++-8
- cmake
script:
- make
+3 -8
View File
@@ -4,6 +4,7 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://github.com/sogou/workflow/blob/master/LICENSE)
[![Language](https://img.shields.io/badge/language-c++-red.svg)](https://en.cppreference.com/)
[![Platform](https://img.shields.io/badge/platform-linux%20%7C%20macos-lightgrey.svg)](#%E9%A1%B9%E7%9B%AE%E7%9A%84%E4%B8%80%E4%BA%9B%E8%AE%BE%E8%AE%A1%E7%89%B9%E7%82%B9)
[![Build Status](https://travis-ci.org/sogou/workflow.svg?branch=master)](https://travis-ci.org/sogou/workflow)
搜狗公司C++服务器引擎,支撑搜狗几乎所有后端C++在线服务,包括所有搜索服务,云输入法,在线广告等,每日处理超百亿请求。这是一个设计轻盈优雅的企业级程序引擎,可以满足大多数C++后端开发需求。
#### 你可以用来:
@@ -34,7 +35,7 @@ int main()
* 作为并行计算工具使用。除了网络任务,我们也包含计算任务的调度。所有类型的任务都可以放入同一个流中。
* 在``Linux``系统下作为文件异步IO工具使用,性能超过任何标准调用。磁盘IO也是一种任务。
* 实现任何计算与通讯关系非常复杂的高性能高并发的后端服务。
* 构建服务网格(service mesh)系统。
* 构建微服务系统。
* 项目内置服务治理与负载均衡等功能。
#### 编译和运行环境
@@ -120,15 +121,9 @@ int main()
* 任何任务都会在callback之后被自动内存回收。如果创建的任务不想运行,则需要通过dismiss方法释放。
* 任务中的数据,例如网络请求的resp,也会随着任务被回收。此时用户可通过``std::move()``把需要的数据移走。
* SeriesWork和ParallelWork是两种框架对象,同样在callback之后被回收。
* 如果某个series是parallel的一个分支,则将在其所在parallel的callback之后再回收。
* 项目中不使用``std::shared_ptr``来管理内存。
# 使用中有疑问?
可以先查看[FAQ](https://github.com/sogou/workflow/issues/170)和[issues](https://github.com/sogou/workflow/issues)列表,看看是否能找到答案。
非常欢迎将您使用中遇到的问题发送到[issues](https://github.com/sogou/workflow/issues),我们将第一时间进行解答。同时更多的issue对新用户也会带来帮助。
#### Authors
* **Xie Han** - *[xiehan@sogou-inc.com](mailto:xiehan@sogou-inc.com)*
* **Wu Jiaxu** - *[void00@foxmail.com](mailto:void00@foxmail.com)*
* **Wang Zhulei** - *[wangzhulei@sogou-inc.com](mailto:wangzhulei@sogou-inc.com)* - Kafka Protocol Implementation
* **Li Yingxin** - *[liyingxin@sogou-inc.com](mailto:liyingxin@sogou-inc.com)*
+4 -7
View File
@@ -35,10 +35,10 @@ int main()
* To implement **client/server on user-defined protocol** and build your own **RPC system**.
* [srpc](https://github.com/sogou/srpc) is based on it and it is an independent open source project, which supports srpc, brpc and thrift protocols.
* To build **asynchronous workflow**; support common **series** and **parallel** structures, and also support any **DAG** structures.
* As a **parallel programming tool**. In addition to **networking tasks**, Sogou C++ Workflow also includes **the scheduling of computing tasks**. All types of tasks can be put into **the same** flow.
* As a **parallel computing tool**. In addition to **networking tasks**, Sogou C++ Workflow also includes **the scheduling of computing tasks**. All types of tasks can be put into **the same** flow.
* As a **asynchronous file IO tool** in `Linux` system, with high performance exceeding any system call. Disk file IO is also a task.
* To realize any **high-performance** and **high-concurrency** back-end service with a very complex relationship between computing and networking.
* To build a **service mesh** system.
* To build a **micro service** system.
* This project has built-in **service governance** and **load balancing** features.
#### Compiling and running environment
@@ -85,6 +85,7 @@ int main()
* [About connection context](docs/en/about-connection-context.md)
* Built-in protocols
* [Asynchronous MySQL client:mysql\_cli](docs/en/tutorial-12-mysql_cli.md)
* [Asynchronous Kafka client: kafka\_cli](docs/tutorial-13-kafka_cli.md)
#### System design features
@@ -128,14 +129,10 @@ Memory reclamation mechanism
* Every task will be automatically reclaimed after the callback. If a task is created but a user does not want to run it, the user needs to release it through the dismiss method.
* Any data in the task, such as the response of the network request, will also be recycled with the task. At this time, the user can use `std::move()` to move the required data.
* SeriesWork and ParallelWork are two kinds of framework objects, which are also recycled after their callback.
* When a series is a branch of a parallel, it will be recycled after the callback of the parallel that it belongs to.
* This project doesn’t use `std::shared_ptr` to manage memory.
#### More design documents
To be continued...
## Authors
* **Xie Han** - *[xiehan@sogou-inc.com](mailto:xiehan@sogou-inc.com)*
* **Wu Jiaxu** - *[wujiaxu@sogou-inc.com](mailto:wujiaxu@sogou-inc.com)*
* **Li Yingxin** - *[liyingxin@sogou-inc.com](mailto:liyingxin@sogou-inc.com)*
+3
View File
@@ -715,6 +715,9 @@ static inline const char *__get_task_error_string(int error)
case WFT_ERR_MYSQL_COMMAND_DISALLOWED:
return "MySQL Command Disallowed";
case WFT_ERR_MYSQL_QUERY_NOT_SET:
return "MySQL Query Not Set";
case WFT_ERR_KAFKA_PARSE_RESPONSE_FAILED:
return "Kafka parse response failed";
+1 -2
View File
@@ -210,13 +210,12 @@ static int parse_ok_packet(const void *buf, size_t len, mysql_parser_t *parser)
if (ret == 0 || p + info_len > buf_end)
return -2;
parser->info_offset = p - (const char *)buf;
parser->info_len = info_len;
} else {
parser->info_offset = 7;
parser->info_len = 0;
}
parser->info_offset = p - (const char *)buf;
parser->offset += parser->info_offset + parser->info_len;
parser->affected_rows = (affected_rows == (unsigned long long)-1) ? 0 : affected_rows;
parser->insert_id = (insert_id == (unsigned long long)-1) ? 0 : insert_id;