mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-05 05:27:35 +08:00
docs: update batch-processor.md (#5212)
This commit is contained in:
parent
b5818cced7
commit
65cfb94b17
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user