docs: update batch-processor.md (#5212)

This commit is contained in:
monitor1379 2021-10-13 17:51:58 +08:00 committed by GitHub
parent b5818cced7
commit 65cfb94b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ or when the buffer duration exceeds.
|Name |Requirement |Description|
|------- |----- |------|
|id |optional |A unique identifier to identity the batch processor|
|name |optional |A unique identifier to identity the batch processor|
|batch_max_size |optional |Max size of each batch, default is 1000|
|inactive_timeout|optional |maximum age in seconds when the buffer will be flushed if inactive, default is 5s|
|buffer_duration|optional |Maximum age in seconds of the oldest entry in a batch before the batch must be processed, default is 5|
@ -43,7 +43,7 @@ The following code shows an example of how to use a batch processor. The batch p
argument and the batch configuration as the second parameter.
```lua
local bp = require("apisix.plugins.batch-processor")
local bp = require("apisix.utils.batch-processor")
local func_to_execute = function(entries)
-- serialize to json array core.json.encode(entries)
-- process/send data

View File

@ -30,7 +30,7 @@ title: 批处理机
|名称 |需求 |描述|
|------- |----- |------|
|id |可选的 |标识批处理者的唯一标识符|
|name |可选的 |标识批处理者的唯一标识符|
|batch_max_size |可选的 |每批的最大大小默认为1000|
|inactive_timeout|可选的 |如果不活动将刷新缓冲区的最大时间以秒为单位默认值为5s|
|buffer_duration|可选的 |必须先处理批次中最旧条目的最大期限以秒为单位默认是5|
@ -40,7 +40,7 @@ title: 批处理机
以下代码显示了如何使用批处理程序的示例。批处理处理器将要执行的功能作为第一个参数,将批处理配置作为第二个参数。
```lua
local bp = require("apisix.plugins.batch-processor")
local bp = require("apisix.utils.batch-processor")
local func_to_execute = function(entries)
-- serialize to json array core.json.encode(entries)
-- process/send data