Download the PHP package lishelun/kdt-queue without Composer

On this page you can find all versions of the php package lishelun/kdt-queue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kdt-queue

NSQ PHP CLIENT

Reference

namespace: Kdt\Iron\Queue\Queue

class Queue

function push(string $topic, mixed $message) : bool

发布单个消息

$message 为 Kdt\Iron\Queue\Message 对象 或简单类型,如 string, array,使用 Message 对象时可以使用一些高级属性

function bulkPush(string $topic, array $messages) : bool

批量发布消息

$messages 是一个一维消息数组

function lastPushError() : string

获取上次发布的错误信息

function pop(mixed $topic, callable $callback, array $options) : mixed

订阅消息。正常退出时会返回 false; 异常退出时返回 string,内容为异常信息

$topic 为 string 时,使用默认的 channel 名 default;指定 channel 时需要传入一个包含 2 个元素的一维数组 [$topic_name, $channel]

$callback 为 function($message),有新消息时会触发回调,参数为 Message 对象。

$options 是一个关系数组,有以下选项:

function exitPop()

退出 pop 后不会再接收新消息

function delete(string $messageId) : bool

删除消息(标记 ACK)

$messageId 通过 Message 对象的 getId() 方法获取

function later(int $seconds)

消息延迟

单位秒,默认情况下最大 3600; 实现机制为抛出一个特定的异常对象 (nsqphp\Exception\RequeueMessageException) 给 SDK,注意外层尽量不要自己包装 try catch

function retry()

消息重试

function close()

主动关闭网络链接,只能在 pop 中使用

class Message

function getId() : string

消息 ID

function getTimestamp() : int

消息产生时间戳

function getAttempts() : int

消息已经重试的次数,包含客户端主动重试和其他未知原因导致的服务端自动重试

function getPayload() : mixed

消息内容

function getTraceID() : int

消息追踪 ID,由生产端传入

function getShardingProof() : int

分区依据

function setTraceID($id) : self

设置消息追踪 ID,会传递到消费端

function setShardingProof(int $sample) : self

设置分区依据,会根据取模结果来决定目标分区


All versions of kdt-queue with dependencies

PHP Build Version
Package Version
Requires react/react Version >=0.2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lishelun/kdt-queue contains the following files

Loading the files please wait ...