2017 © Pedro Peláez
 

library file-queue

file-queue

image

kyanag/file-queue

file-queue

  • Wednesday, November 8, 2017
  • by kyanag
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

php-queque

php实现的基于 文件 的队列, 即把文件当做内存进行操作, (*1)

说明

  1. 文件当做容器, 所以本身就是可以持久化的
  2. 消息长度是固定的(消息就是一条队列数据)
  3. 完全基于php

文件格式

前10个字节为 队列描述, (*2)

1字节    一个消息占用空间(不大于256个字节, 超出会截断)
2字节    头指针归0次数  (感觉这个好像没啥意义, 但是还是留着了)
34字节为 队列头部定位    (偏移量为 value * 消息大小即第一个字节的值)
56字节为 队列尾部定位    (同上)
78字节为 当前消息数量    
9,10字节为 最大消息数量  (队列容量, 因为头部尾部的关系, 最大256 * 256)

以后的就是消息内容了

使用见 test.php, (*3)

The Versions

08/11 2017

dev-master

9999999-dev

file-queue

  Sources   Download

The Requires

 

by Avatar kyanag

18/03 2017

0.03

0.03.0.0

file-queue

  Sources   Download

The Requires

 

by Avatar kyanag

17/03 2017

0.02

0.02.0.0

file-queue

  Sources   Download

The Requires

 

by Avatar kyanag

17/03 2017

dev-dev

dev-dev

file-queue

  Sources   Download

The Requires

 

by Avatar kyanag