定制 balpom/symfony-messenger-sqlite 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

balpom/symfony-messenger-sqlite

最新稳定版本:v1.0.2

Composer 安装命令:

composer require balpom/symfony-messenger-sqlite

包简介

How to initialize and to use a Symfony Messenger with queues in SQLite database without Doctrine.

README 文档

README

A simple example showing how to initialize and to use a Symfony Messenger with queues in SQLite database without Doctrine.

It is modified example from https://github.com/balpom/symfony-messenger-sample, which use Doctrine https://github.com/symfony/doctrine-messenger as message transport.

This example use https://github.com/balpom/sql-messenger as transport. It use SQLite database by PDO and without Doctrine.

Everything was tested in Linux.

Requirements

  • PHP >= 8.1

Installation

Using composer (recommended)

composer create balpom/symfony-messenger-sqlite

How to use

Simple test

Open console window. Run the command:

php bin/console messenger:consume sql-async

It starts simple Worker, which imitate SMS sending. Now it is waiting for messages to be sent from the queue, which is still empty.

Open another console window. Run the command:

php tests/send.php

It runs a simple script that adds several messages to the queue. After this, in first console window you may see, how Worker "sending" SMS.

Run the command:

php bin/console messenger:stop-workers

It stop Worker execution.

Advanced test

Open multiple consoles. In each of them, run the command:

php bin/console messenger:consume sql-async

It starts many simple Workers, which imitate SMS sending. Now it is waiting for messages to be sent from the queue, which is still empty.

Open one more console window. Run the command:

php tests/sendmany.php

It runs a simple script that adds many several messages to the queue. After this, in previously opened consoles you may see, how several Workers "sending" SMS.

Run the command:

php bin/console messenger:stop-workers

It stop all Workers executions.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固