Closed mabdullahsari closed 1 year ago
Thanks for explaining. I'm going to pass on this as in the vast majority of cases having the SerializesModels
trait won't pose a real-world problem.
I'll take a look again when working on a new major version.
Hi π
This PR removes the
SerializesModels
trait from the baseProcessWebhookJob
class.Please allow me to explain the reasoning behind this change proposal. The documentation states (verbatim):
While this behavior is fine for the vast majority of use cases out there, I think that free performance gains are left on the table by utilizing this trait within this particular context of webhooks. As you may already know, incoming webhooks are essentially events dispatched over Http, and by definition events are always immutable because they represent things that happened in the past. This immutable nature of events guarantees us that no changes to the serialized
WebhookCall
are going to occur by the time a queue worker picks up the job and starts processing it. Consequently, each processed job is no longer going to make an additional database query to retrieve the serialized model thus resulting in performance improvements.I don't think that
Job
payload is going to be an issue, as most webhook payloads have a small footprint anyway.This is definitely a breaking change, and I'm targeting
main
right now because there was no other option. I'm definitely glad to close and re-open the PR if anext
orv4
branch is made.Thanks π