title: Temporary storage for collecting data prior to sending
body: <p>I'm working on a composer package for PHP apps. The goal is to send some data after requests, queue jobs, other actions that are taken. My initial (and working) idea is to use <code>register_shutdown_function</code> to do it. There are a couple of issues with this approach, firstly, this increases the page response time, meaning that there's the overhead of computing the request, plus sending the data via my API. Another issue is that long-running processes, such as queue workers, do not execute this method for a long time, therefore there might be massive gaps between when the data was created and when it's sent and processed.</p>
  
  <p>My thought is that I could use some sort of temporary storage to store the data and have a cronjob to send it every minute. The only issue I can see with this approach is managing concurrency on hight IO. Because many processes will be writing to the file every (n) ms, there's an issue with reading the file and removing lines that had been already sent.</p>
  
  <p>Another option which I'm trying to desperately avoid is using the client database. This could potentially cause performance issues.</p>
  
  <p>What would be the preferred way to do this?</p>
  
  <p>Edit: the package is essentially a monitoring agent.</p>