The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojolicious::Plugin::DirectoryQueue - Mojolicious 应用使用的内部队列服务, 基本本地文件系统的队列系统 , 为方便做任务应用使用.

SYNOPSIS

    plugin 'DirectoryQueue' => {
        path => '/tmp/DirQueue',
    };

DESCRIPTION

Mojolicious::Plugin::DirectoryQueue 这个模块主要是基于本地文件系统, 创建一个队列服务, 为 Mojolicious 的多进程时共享使用, 并可以很简单方便的和第三方结合. 如果直接给 Mojolicious 内部使用事件驱动的其它功能可以直接使用这个来做内部的队列调度.

默认内部传送的入队可以直接使用任意的数据库结构. 会被序列化成 json 结构.

配置

path
  path => '/tmp/DirQueue',

用于设置队列存放的位置

方法

enqueue

入队, 可以传送任意数据结构到队列中, 会被存成 json 结构到队列系统内部 ( 文件系统 ).

dequeue

出队, 取出队列中一个任务, 结果会被反序列化成数据结构.

show

一次性查看所有的队列中的任务的详细信息. 这时会给所有的数据都显示出来. 并不删除任务.

count

当前队列中所存在的任务数量

purge

调用的时候清除任务 hash 时不用的文件夹

AUTHOR

fu kai <iakuf {at} 163.com>

SEE ALSO

Directory::Queue

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.