承接 pond5/async-request-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

pond5/async-request-bundle

Composer 安装命令:

composer require pond5/async-request-bundle

包简介

This bundle allows sending requests to a Symfony Messenger transport to be handled later by a consumer

README 文档

README

Pond5 Async Request Bundle codecov Latest Stable Version Total Downloads

This bundle allows sending requests to a Symfony Messenger transport to be handled later by a consumer.

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

composer require pond5/async-request-bundle

Applications that don't use Symfony Flex

  1. Add config file
# config/packages/pond5_async_request.yaml
pond5_async_request:
    #header: X-Request-Async # user defined header name to indicate asynchronous request - X-Request-Async used by default
    #methods: [DELETE, PATCH, POST, PUT] # HTTP methods that should support async requests
    transport: async-request # messenger transport name, ignored if messenger routing for Pond5\AsyncRequestBundle\Message\AsyncRequestNotification is configured manually

# can be omitted when using transport configured in another file (e.g. messenger.yaml)
framework:
    messenger:
        transports:
            async-request: '%env(MESSENGER_TRANSPORT_DSN)%'
  1. Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

composer require pond5/async-request-bundle
  1. Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    Pond5\AsyncRequestBundle\Pond5AsyncRequestBundle::class => ['all' => true],
];

Usage

  1. Add X-Request-Async header a DELETE, PATCH, POST, PUT request, e.g.
curl -i -X POST http://example.org/endpoint -H "X-Request-Async: 1"

Symfony should respond with 202 status code and empty body:

HTTP/1.1 202 Accepted
Content-Length: 0
  1. Handle the request/consume the message
bin/console messenger:consume

Test

  1. Install dev dependencies.
composer install
  1. Run unit tests.
bin/phpunit

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 13
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固