Skip to content

Conversation

ejegg
Copy link
Contributor

@ejegg ejegg commented Mar 16, 2017

  • Removes our non-queuey KeyValueStore and IndexedFifoQueueStore interfaces
    These were only supported by certain backends, and support in those was buggy (i.e. delete in ActiveMQ only works if the key is within a certain distance of the top)
  • Adds an AtomicReadBuffer interface
    Useful for at-least-once processing. Gets a value from the queue and only pops it off once a callback has completed successfully
  • Bugfixes for Predis and PDO backends

Please let me know if you'd like me to break up this PR!

ejegg and others added 29 commits March 16, 2017 17:09
Make it an all-purpose additional properties array, as in Stomp.
For Memcache backend, preserve existing behavior when passing an
int.

Change-Id: Ia475d6cc85e6dc091f1af93b787e2f28f9aedfb3
Change-Id: Ie703739c4939f55e435a62fd01e83970c68735c8
Change-Id: Iaa1224e303fe187470284c4fa697ce71d4ef02fd
Bug: T107852
Change-Id: I9e3c98e9dcd76346ac2ff547d2dfc55dafba97f8
Bug: T107852
Change-Id: Ib731a0f1c0c5eadf9ddf62c3db27d9dcb5561f6a
Turns out different PHP versions have different ideas of what you can do
from a closure.

Change-Id: I466af6fc3e48811fcfa66f4902b3765dadf3efba
Response types vary by command.  Take care to convert the meaning of each type
to the correct trueish value, for example "ERR" usually means we should return
false, or at times 0 could be a successful result.

Bug: T109527
Change-Id: Ic669a7259b5eae03f3c366e812b0039325363678
Skips PDO and Memcache tests if initial probing fails.

Bug: T133574
Change-Id: Iafc3b451a0e7ccc5804dcc2b2336c50683911fbd
Change-Id: I83b60ac048f5fbc1596aa1e1ac1ba1ca601870de
The create syntax was MySQL-only, so put it in a conditional and die under any
other db, for now.

Change-Id: Ic8fa30f815d189f211782d66ce62b83786b9f8ef
Change-Id: I15ba65d689fc450f7ddc81d05333be5d9a0acf36
We make a wild guess here, but it should be robust at least.

If the push is still unsuccessful, throw an exception.

Change-Id: Ia11e81ec3bcd731181c503680583ae4f331a7c1b
The new AtomicReadBuffer data source provides opaque access to any FIFO-like
buffer that supports manual commit of pop operations.  This interface is only
used for this one popAtomic operation.

They are processed one at a time by a client-defined callback, and any uncaught
Exception causes the pop to be rolled back.

Bug: T131271
Bug: T131269
Change-Id: I3a704669a65fcc7d55b8d6a354d4f16aee586dc7
Otherwise we get a PDOException: SQLSTATE[42000] [1101] BLOB, TEXT,
GEOMETRY or JSON column 'data' can't have a default value

Change-Id: I3a6005a5c5b1ab982314fa886be38750cb794860
Change-Id: I9150c8b997318afd61988b866e5e7aca16d9abe0
Also run PDO unit tests with both supported drivers.

Change-Id: I6def3c3b0e56a3d0608478bb11516077d054d695
Callbacks should expect actual messages and not have to check for
the end of the queue.

Change-Id: I2fd93aa6f7ea6ba796a83a67a33f3bf9e02f72b8
Makes implicit table creation work for push()
TODO: support same for set()

Change-Id: Icef80590d0ce1ebe5643489c577e3b744c47d467
Bug: T133964
Change-Id: I7108a897360b6e398309d7d51e08f2b8e35f66b3
Change-Id: I9d9275c6106871835c735777828279f98e106fb4
On php 5.3, $callback($data) was giving this error:
 PHP Fatal error:  Function name must be a string

Change-Id: Id1c1c2d69602f704fcbdd01ff67dc793b79167f4
bindParam passes by reference, which doesn't work for values like
self::getTimestamp(). Makes tests work under php7.

Change-Id: Ib153bc4fb86cee68d307aed2b33cf44b7abd4a15
Change-Id: Ifddcc295de12a8ccf711fba1a4b3e24a70850f67
Bug: T147532
Change-Id: I684d517e73d74dd5e7e4682cdb72ff6b0c3fa7f4
We need this e.g. to be able to open a sqlite connection with
ATTR_PERSISTENT = true. array_merge was re-keying the array and
using the wrong attributes.

Change-Id: I1d272377b5142785ab17a91d7664d121241a565f
Quit throwing exceptions when the queue is empty.

Change-Id: Ie5479c81c0a6138e1cad416b40d3edabffb1e9c4
Was extending non-existent class
\PHPQueue\Exception\PHPQueue\Exception\Exception

Change-Id: I11a57e964fb25af177a55eda509e2fa0e987abb3
At one point, I had introduced a hybrid FIFO and key-value interface for
backwards compatiblity with some Wikimedia Fundraising code.  Now we've
decided to use pure FIFO queues and can remove this nastiness.

Change-Id: I6f38b1528c1ec33c8d248ef700d444637677be51
Change-Id: Iec19cba24743ccffae146b6ed37e1edaec1658f6
@miccheng
Copy link
Member

miccheng commented Mar 17, 2017 via email

@miccheng miccheng merged commit dd8412f into CoderKungfu:master Apr 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants