eonx-com/easy-webhook
Composer 安装命令:
composer require eonx-com/easy-webhook
包简介
Sending webhooks has never been so easy (persistence, retry, async)
README 文档
README
---eonx_docs--- title: Introduction weight: 0 ---eonx_docs---
Introduction
The EasyWebhook package allows you to implement flexible, configurable webhook functionality in your projects. A webhook is a mechanism for sending HTTP requests to URLs, typically with information about an event that has occurred in your application.
Using the EasyWebhook package, you can:
- Configure webhooks
- Send webhooks as HTTP requests to URLs and retry them if they fail
- Send webhooks synchronously or asynchronously
- Receive webhook responses
- Persist webhooks and results into a store of your choice
- Dispatch events upon success or failure of webhooks
Require package (Composer)
The recommended way to install this package is to use Composer:
$ composer require eonx-com/easy-webhook
Usage overview
The Webhook class defines the configuration for a webhook, e.g. the URL to send webhook HTTP requests.
The WebhookClient class triggers the processing of the stack of middleware that applies to the webhook.
The middleware stack is the workhorse of the EasyWebhook package. Each middleware in the stack is responsible for a distinct part of the webhook processing, including:
- Sending webhooks as HTTP requests.
- Getting the responses of the HTTP requests, using the WebhookResult class class to hold the responses.
- Retrying webhooks if necessary. The EasyWebhook package has a default retry strategy but you can implement your own. See Retry strategies for more information.
- Persisting webhooks and their responses in stores. You can implement your own stores, but the EasyWebhook package comes with three store options out of the box: null store, array store and Doctrine DBAL store. See Stores for more information.
- Dispatching events upon success or failure of webhooks. See Events for more information.
See Middleware for detailed information about middleware, including how to implement custom middleware.
By default, webhooks are sent asynchronously, but you can configure a webhook to be sent synchronously. See Sending synchronously for more information.
Webhooks can be configured to be sent after a particular date and time. You can run the
easy-webhooks:send-due-webhooks console command in a cron job to send due webhooks. See Console for more
information.
Global settings for the EasyWebhook package can be configured via a configuration file in your application. See Configuration for more information.
eonx-com/easy-webhook 适用场景与选型建议
eonx-com/easy-webhook 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.13M 次下载、GitHub Stars 达 8, 最近一次更新时间为 2020 年 07 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eonx-com/easy-webhook 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eonx-com/easy-webhook 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.13M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 15
- 依赖项目数: 2
- 推荐数: 3
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-21