jeremka/write-async-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jeremka/write-async-bundle

最新稳定版本:v0.1.0

Composer 安装命令:

composer require jeremka/write-async-bundle

包简介

Seamless async write operations for API Platform (ORM & ODM)

README 文档

README

A bundle for API Platform 3 / Symfony 6.4 that ships your write operations (POST, PUT, PATCH) to Symfony Messenger

Why?

  • You don’t want the HTTP request to wait for a flush() that isn’t critical
    (view counters, logs, “seen” flags, …).
  • You just want to say: “Take this payload, deal with it later.”

Quick install

composer require jeremka/write-async-bundle

Make sure you have (at least) one Messenger transport:

#messenger.yaml

framework:
messenger:
transports:
low_priority: '%env(MESSENGER_LOW_DSN)%'

Change the default transport (optional):

write_async.yaml

write_async:
default_transport: low_priority

Enable it on a route

  1. extraProperties (one-liner)
#[Patch(
uriTemplate: '/posts/{id}',
extraProperties: [
'write_async' => true,
'transport'   => 'low_priority' // optionnel
],
status: 202,
output: false
)]
class Post {}

OR

  1. Detached attribute
use Jeremka\WriteAsyncBundle\Attribute\WriteAsyncPatch;

#[WriteAsyncPatch('/posts/{id}', transport: 'low_priority')]
class Post {}

And… that’s it!

No DTO, no custom handler:

  • API Platform still handles validation, deserialization, and security voters.
  • The bundle intercepts the write phase, builds an AsyncWriteMessage, and dispatches it to the queue.
  • The client instantly receives 202 Accepted.
  • A Messenger worker reloads the entity later, applies the diff, and performs the real flush().

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固