swoole_table
基于共享内存和锁 实现超高性能的并发结构 用于解决多进程/多线程数据共享和同步加锁问题(高性能高并发架构)
全部 都是内存操作,零IO操作,每秒的写操作在300W+
table.php文件内容:
<?php
/**
* [$table 创建表 指定表大小为1024 2的N次方]
* @var swoole_table
*/
$table = new swoole_table(1024);
/**
* 设置表的列
* [$size description]
* @var [type]
*/
$table->column('id',$table::TYPE_INT,4);
$table->column('name',$table::TYPE_STRING,64);
$table->column('age',$table::TYPE_INT,2);
$table->create();
$table->set('demo',['id'=>1,'name'=>'jack','age'=>12]);
$table->set('demo2',['id'=>2,'name'=>'tom','age'=>15]);
$table->set('demo3',['id'=>3,'name'=>'able','age'=>18]);
// $row = $table->get('demo');
// print_r($row);
// echo $table->count();
//
echo $table->exist('demo');