Mojolicious::Plugin::DirectoryQueue - Mojolicious 应用使用的内部队列服务, 基本本地文件系统的队列系统 , 为方便做任务应用使用.
plugin 'DirectoryQueue' => { path => '/tmp/DirQueue', };
Mojolicious::Plugin::DirectoryQueue 这个模块主要是基于本地文件系统, 创建一个队列服务, 为 Mojolicious 的多进程时共享使用, 并可以很简单方便的和第三方结合. 如果直接给 Mojolicious 内部使用事件驱动的其它功能可以直接使用这个来做内部的队列调度.
默认内部传送的入队可以直接使用任意的数据库结构. 会被序列化成 json 结构.
path => '/tmp/DirQueue',
用于设置队列存放的位置
入队, 可以传送任意数据结构到队列中, 会被存成 json 结构到队列系统内部 ( 文件系统 ).
出队, 取出队列中一个任务, 结果会被反序列化成数据结构.
一次性查看所有的队列中的任务的详细信息. 这时会给所有的数据都显示出来. 并不删除任务.
当前队列中所存在的任务数量
调用的时候清除任务 hash 时不用的文件夹
fu kai <iakuf {at} 163.com>
Directory::Queue
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojolicious::Plugin::DirectoryQueue, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::DirectoryQueue
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::DirectoryQueue
For more information on module installation, please visit the detailed CPAN module installation guide.