Skip to content

Commit

Permalink
add Number of messages WS queue shuold hold, default 100
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Jan 26, 2021
1 parent 833887f commit d4e692c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ $bitmex->config([
//Heartbeat time,default 30 seconds
//'ping_time'=>30,

//Number of messages WS queue shuold hold, default 100
//'queue_count'=>100,

//baseurl host
//'baseurl'=>'ws://www.bitmex.com/realtime',//default
//'baseurl'=>'ws://testnet.bitmex.com/realtime',//test
Expand Down Expand Up @@ -232,6 +235,12 @@ $bitmex->config([
//Heartbeat time,default 30 seconds
//'ping_time'=>30,

//Number of messages WS queue shuold hold, default 100
//'queue_count'=>100,

//私有数据队列默认保存100条
//'queue_count'=>100,

//baseurl host
//'baseurl'=>'ws://www.bitmex.com/realtime',//default
//'baseurl'=>'ws://testnet.bitmex.com/realtime',//test
Expand Down
3 changes: 3 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ $bitmex->config([
//心跳时间默认 30 seconds
//'ping_time'=>30,

//私有数据队列默认保存100条
//'queue_count'=>100,

//baseurl host 地址设置
//'baseurl'=>'ws://www.bitmex.com/realtime',//默认地址
//'baseurl'=>'ws://testnet.bitmex.com/realtime',//test
Expand Down
2 changes: 1 addition & 1 deletion src/Api/WebSocket/SocketGlobal.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function getQueue($key){
*/
protected function saveQueue($key,$value){
//最大存储数据量,超过后保留一条最新的数据,其余数据全部删除。
$max=100;
$max= isset($this->config['queue_count']) ? $this->config['queue_count'] : 100;

if(!isset($this->client->$key)) $this->add($key,[$value]);
else {
Expand Down

0 comments on commit d4e692c

Please sign in to comment.