发布于 2015-08-09 09:45:48 | 383 次阅读 | 评论: 0 | 来源: 网络整理
创建内存表。
swoole_table->create()
swoole_table使用共享内存来保存数据,在创建子进程前,务必要执行swoole_table->create()
swoole_server中使用swoole_table,swoole_table->create() 必须在swoole_server->start()前执行
$table = new swoole_table(1024);
$table->column('id', swoole_table::TYPE_INT, 4); //1,2,4,8
$table->column('name', swoole_table::TYPE_STRING, 64);
$table->column('num', swoole_table::TYPE_FLOAT);
$table->create();
$worker = new swoole_process('child1', false, false);
$worker->start();
//$serv = new swoole_server('127.0.0.1', 9501);
//$serv->start();