Skip to content

Instantly share code, notes, and snippets.

View Jervelund's full-sized avatar

Sigurd Jervelund Hansen Jervelund

  • Eupry ApS
  • Copenhagen
View GitHub Profile
@Jervelund
Jervelund / work_queue.php
Created March 1, 2016 04:03
PHP semaphore worker queue
<?PHP
/*
Simple implementation of process queue in PHP using MySQL database.
This method does not use simple semaphores, as it is impotant for the application to run input in sequential order for each thread (order of data received).
CREATE TABLE IF NOT EXISTS `sessions` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`thread` int(11) NOT NULL,
`time_initiated` decimal(14,4) unsigned NOT NULL,
`time_heartbeat` decimal(14,4) unsigned NOT NULL,

Keybase proof

I hereby claim:

  • I am jervelund on github.
  • I am jervelund (https://keybase.io/jervelund) on keybase.
  • I have a public key whose fingerprint is 119C EBC7 31D2 E966 D57A 4ED3 28D4 9896 B18E 5843

To claim this, I am signing this object: