Closed subzero10 closed 5 months ago
- There doesn't seem to be a timer to periodically flush the events queue, which could result in an event not being sent if it's added to the queue, but then another event isn't added, which could trigger the size or timeout thresholds being crossed.
PHP scripts are single threaded and usually short lived. For this reason, I opted for a shutdown listener to send any events that are still left in the queue when the script is exiting. I did come across a register_tick_function
, which you can use to execute a callback every n-ticks (note: they don't translate to seconds). I didn't do it though because it may be unnecessary considering the above and I've never used it before. Additionally, different versions of PHP have different implementations of this feature. I'll ask TJ on Slack (thanks @joshuap) to get some feedback and can implement it in a follow-up PR if needed.
- The method signature for event doesn't support the option (as the Ruby gem does) to pass a hash instead of a string as the first argument.
I pushed a commit with an updated signature. I have to admit that I'm not loving this solution because it messes with PHP's latest improvements to type declarations. Unfortunately PHP doesn't have a good way for method overloading.
Status
READY
Description
Honeybadger Insights integration. Adds a
Honeybadger.event()
function that allows sending events to Insights. Closes: #190Todos
BulkEventDispatcher
to send events in bulkNext up
192