-
Notifications
You must be signed in to change notification settings - Fork 69
Upstreaming the rest of WMF's changes #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
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
Wow... thanks.
Please give me some time to look into it.
…On Fri, 17 Mar 2017 at 6:25 AM, Elliott Eggleston ***@***.***> wrote:
- 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!
------------------------------
You can view, comment on, or merge this pull request online at:
#56
Commit Summary
- Standardize 3rd parameter of 'set' for KeyValueStore
- Fix self:: style PHP version incompatibility
- pop() should ignore expired or missing elements
- Provide a method to peek at the top element of a queue
- Don't fetch data if we're just testing for existence
- change function access for old PHP
- Interpret Predis status codes
- Clean up enough that composer test job will run
- Support "queue" as an alias for "db_table"
- Add a timestamp column; specify MySQL syntax
- Typo
- Check success in push and create table if necessary
- New interface for atomic reads
- Fix table creation in strict mode
- SQLite support for PDO backend
- PHPdoc fix
- popAtomic doesn't run callback if queue is empty
- Catch prepare($sql) exceptions on missing table
- Implement popAtomic for Redis
- Reword docs; stop doing popAtomic(function () {})
- Use call_user_func for popAtomic
- bindValue instead of bindParam
- Return null from php-queue\PDO&pop() when missing table
- Throw an exception when we can't decode JSON
- Fix bad pdo_options merge
- Decoding null to null is not an error
- Fix JsonException extends statement
- Remove unused key-value dead-end
- Remove KeyValue interfaces from README
File Changes
- *M* README.md
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-0> (23)
- *M* composer.json
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-1> (2)
- *M* src/PHPQueue/Backend/Beanstalkd.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-2> (4)
- *M* src/PHPQueue/Backend/IronMQ.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-3> (4)
- *M* src/PHPQueue/Backend/Memcache.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-4> (16)
- *M* src/PHPQueue/Backend/MongoDB.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-5> (4)
- *M* src/PHPQueue/Backend/PDO.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-6> (129)
- *M* src/PHPQueue/Backend/Predis.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-7> (209)
- *M* src/PHPQueue/Backend/Stomp.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-8> (3)
- *A* src/PHPQueue/Exception/JsonException.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-9> (9)
- *A* src/PHPQueue/Interfaces/AtomicReadBuffer.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-10> (43)
- *D* src/PHPQueue/Interfaces/IndexedFifoQueueStore.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-11> (31)
- *D* src/PHPQueue/Interfaces/KeyValueStore.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-12> (28)
- *A* src/PHPQueue/Json.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-13> (17)
- *M* test/PHPQueue/Backend/MemcacheTest.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-14> (29)
- *A* test/PHPQueue/Backend/PDOBaseTest.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-15> (174)
- *A* test/PHPQueue/Backend/PDOMysqlTest.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-16> (28)
- *A* test/PHPQueue/Backend/PDOSqliteTest.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-17> (18)
- *D* test/PHPQueue/Backend/PDOTest.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-18> (110)
- *M* test/PHPQueue/Backend/PredisTest.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-19> (31)
- *D* test/PHPQueue/Backend/PredisZsetTest.php
<https://github.com/CoderKungfu/php-queue/pull/56/files#diff-20> (106)
Patch Links:
- https://github.com/CoderKungfu/php-queue/pull/56.patch
- https://github.com/CoderKungfu/php-queue/pull/56.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#56>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAM8DLPodkXHK1LQUSzIQ5Ccyna86TsRks5rmbb0gaJpZM4Mf9LW>
.
|
miccheng
approved these changes
Apr 17, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)
Useful for at-least-once processing. Gets a value from the queue and only pops it off once a callback has completed successfully
Please let me know if you'd like me to break up this PR!