Hello community,
here is the log from the commit of package perl-Mojo-Redis for openSUSE:Factory
checked in at 2019-06-14 20:42:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojo-Redis (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojo-Redis.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojo-Redis"
Fri Jun 14 20:42:19 2019 rev:3 rq:709780 version:3.24
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojo-Redis/perl-Mojo-Redis.changes
2019-02-02 21:50:16.835927213 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Mojo-Redis.new.4811/perl-Mojo-Redis.changes
2019-06-14 20:42:21.774396667 +0200
@@ -1,0 +2,49 @@
+Wed May 8 05:14:29 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 3.24
+ see /usr/share/doc/packages/perl-Mojo-Redis/Changes
+
+ 3.24 2019-05-07T22:25:50+0700
+ - Fix PubSub->keyspace_listen() #42
+
+-------------------------------------------------------------------
+Sun May 5 05:18:11 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 3.23
+ see /usr/share/doc/packages/perl-Mojo-Redis/Changes
+
+ 3.23 2019-05-04T21:12:25+0700
+ - Fix compatibility with Mojolicious 8.15 #46
+
+-------------------------------------------------------------------
+Thu Apr 25 05:16:45 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 3.22
+ see /usr/share/doc/packages/perl-Mojo-Redis/Changes
+
+ 3.22 2019-04-24T12:32:18+0700
+ - Forgot to update protocol parser for Mojo::Redis::Cache after 3.21 #43
+ - Fix broken link in Mojo::Redis::Connection #44
+ Contributor: Mohammad S Anwar
+
+-------------------------------------------------------------------
+Tue Apr 16 05:15:50 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 3.21
+ see /usr/share/doc/packages/perl-Mojo-Redis/Changes
+
+ 3.21 2019-04-16T09:58:44+0700
+ - Changed default protocol parser to Protocol::Redis::XS #43
+
+-------------------------------------------------------------------
+Thu Apr 4 05:14:51 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 3.20
+ see /usr/share/doc/packages/perl-Mojo-Redis/Changes
+
+ 3.20 2019-04-04T10:31:03+0700
+ - Use Protocol::Redis::Faster instead of Protocol::Redis #38
+ - Only decode data from bulk string responses #40
+ - Fix allowing custom URL object with userinfo in constructor #41
+
+-------------------------------------------------------------------
Old:
----
Mojo-Redis-3.19.tar.gz
New:
----
Mojo-Redis-3.24.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojo-Redis.spec ++++++
--- /var/tmp/diff_new_pack.X0JJmc/_old 2019-06-14 20:42:22.406395595 +0200
+++ /var/tmp/diff_new_pack.X0JJmc/_new 2019-06-14 20:42:22.410395588 +0200
@@ -17,7 +17,7 @@
Name: perl-Mojo-Redis
-Version: 3.19
+Version: 3.24
Release: 0
%define cpan_name Mojo-Redis
Summary: Redis driver based on Mojo::IOLoop
@@ -31,10 +31,10 @@
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Mojolicious) >= 7.80
-BuildRequires: perl(Protocol::Redis) >= 1.0006
+BuildRequires: perl(Protocol::Redis::Faster) >= 0.002
BuildRequires: perl(Test::More) >= 0.88
Requires: perl(Mojolicious) >= 7.80
-Requires: perl(Protocol::Redis) >= 1.0006
+Requires: perl(Protocol::Redis::Faster) >= 0.002
%{perl_requires}
%description
++++++ Mojo-Redis-3.19.tar.gz -> Mojo-Redis-3.24.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/.vstags new/Mojo-Redis-3.24/.vstags
--- old/Mojo-Redis-3.19/.vstags 1970-01-01 01:00:00.000000000 +0100
+++ new/Mojo-Redis-3.24/.vstags 2019-04-09 04:16:28.000000000 +0200
@@ -0,0 +1,188 @@
+!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;"
to lines/
+!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
+!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
+!_TAG_PROGRAM_NAME Exuberant Ctags //
+!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
+!_TAG_PROGRAM_VERSION 5.8 //
+CONNECT_TIMEOUT lib/Mojo/Redis/Connection.pm 9;" c
+DEBUG lib/Mojo/Redis/Connection.pm 8;" c
+DEBUG lib/Mojo/Redis/PubSub.pm 6;" c
+DESTROY lib/Mojo/Redis/Connection.pm 17;" s
+DESTROY lib/Mojo/Redis/Cursor.pm 129;" s
+DESTROY lib/Mojo/Redis/Database.pm 209;" s
+Mojo::Redis lib/Mojo/Redis.pm 1;" p
+Mojo::Redis::Cache lib/Mojo/Redis/Cache.pm 1;" p
+Mojo::Redis::Cache::OFFLINE lib/Mojo/Redis/Cache.pm 10;" c
+Mojo::Redis::Cache::_compute_p lib/Mojo/Redis/Cache.pm 48;" s
+Mojo::Redis::Cache::_maybe_compute_p lib/Mojo/Redis/Cache.pm 64;" s
+Mojo::Redis::Cache::_offline_connection lib/Mojo/Redis/Cache.pm 87;"
s
+Mojo::Redis::Cache::compute_p lib/Mojo/Redis/Cache.pm 24;" s
+Mojo::Redis::Cache::memoize_p lib/Mojo/Redis/Cache.pm 39;" s
+Mojo::Redis::Connection lib/Mojo/Redis/Connection.pm 1;" p
+Mojo::Redis::Connection::CONNECT_TIMEOUT lib/Mojo/Redis/Connection.pm
9;" c
+Mojo::Redis::Connection::DEBUG lib/Mojo/Redis/Connection.pm 8;" c
+Mojo::Redis::Connection::DESTROY lib/Mojo/Redis/Connection.pm 17;"
s
+Mojo::Redis::Connection::Offline lib/Mojo/Redis/Cache.pm 89;" p
+Mojo::Redis::Connection::Offline::_time lib/Mojo/Redis/Cache.pm 114;"
s
+Mojo::Redis::Connection::Offline::write_p lib/Mojo/Redis/Cache.pm 93;"
s
+Mojo::Redis::Connection::SENTINELS_CONNECT_TIMEOUT
lib/Mojo/Redis/Connection.pm 10;" c
+Mojo::Redis::Connection::_connect lib/Mojo/Redis/Connection.pm 55;"
s
+Mojo::Redis::Connection::_connect_args lib/Mojo/Redis/Connection.pm 94;"
s
+Mojo::Redis::Connection::_discover_master lib/Mojo/Redis/Connection.pm
109;" s
+Mojo::Redis::Connection::_encode lib/Mojo/Redis/Connection.pm 47;"
s
+Mojo::Redis::Connection::_id lib/Mojo/Redis/Connection.pm 147;" s
+Mojo::Redis::Connection::_is_blocking lib/Mojo/Redis/Connection.pm 149;"
s
+Mojo::Redis::Connection::_on_close_cb lib/Mojo/Redis/Connection.pm 151;"
s
+Mojo::Redis::Connection::_on_read_cb lib/Mojo/Redis/Connection.pm 166;"
s
+Mojo::Redis::Connection::_parse_message_cb lib/Mojo/Redis/Connection.pm
178;" s
+Mojo::Redis::Connection::_reject_queue lib/Mojo/Redis/Connection.pm 222;"
s
+Mojo::Redis::Connection::_write lib/Mojo/Redis/Connection.pm 230;"
s
+Mojo::Redis::Connection::disconnect lib/Mojo/Redis/Connection.pm 22;"
s
+Mojo::Redis::Connection::is_connected lib/Mojo/Redis/Connection.pm 30;"
s
+Mojo::Redis::Connection::write_p lib/Mojo/Redis/Connection.pm 32;"
s
+Mojo::Redis::Connection::write_q lib/Mojo/Redis/Connection.pm 40;"
s
+Mojo::Redis::Cursor lib/Mojo/Redis/Cursor.pm 1;" p
+Mojo::Redis::Cursor::DESTROY lib/Mojo/Redis/Cursor.pm 129;" s
+Mojo::Redis::Cursor::_next_p lib/Mojo/Redis/Cursor.pm 107;" s
+Mojo::Redis::Cursor::_process_hgetall lib/Mojo/Redis/Cursor.pm 120;"
s
+Mojo::Redis::Cursor::_process_hkeys lib/Mojo/Redis/Cursor.pm 121;"
s
+Mojo::Redis::Cursor::_process_hscan lib/Mojo/Redis/Cursor.pm 122;"
s
+Mojo::Redis::Cursor::_process_keys lib/Mojo/Redis/Cursor.pm 123;"
s
+Mojo::Redis::Cursor::_process_scan lib/Mojo/Redis/Cursor.pm 124;"
s
+Mojo::Redis::Cursor::_process_smembers lib/Mojo/Redis/Cursor.pm 125;"
s
+Mojo::Redis::Cursor::_process_sscan lib/Mojo/Redis/Cursor.pm 126;"
s
+Mojo::Redis::Cursor::_process_zscan lib/Mojo/Redis/Cursor.pm 127;"
s
+Mojo::Redis::Cursor::again lib/Mojo/Redis/Cursor.pm 11;" s
+Mojo::Redis::Cursor::all lib/Mojo/Redis/Cursor.pm 18;" s
+Mojo::Redis::Cursor::all_p lib/Mojo/Redis/Cursor.pm 46;" s
+Mojo::Redis::Cursor::command lib/Mojo/Redis/Cursor.pm 7;" s
+Mojo::Redis::Cursor::finished lib/Mojo/Redis/Cursor.pm 8;" s
+Mojo::Redis::Cursor::new lib/Mojo/Redis/Cursor.pm 86;" s
+Mojo::Redis::Cursor::next lib/Mojo/Redis/Cursor.pm 60;" s
+Mojo::Redis::Cursor::next_p lib/Mojo/Redis/Cursor.pm 81;" s
+Mojo::Redis::Database lib/Mojo/Redis/Database.pm 1;" p
+Mojo::Redis::Database::DESTROY lib/Mojo/Redis/Database.pm 209;" s
+Mojo::Redis::Database::_add_method lib/Mojo/Redis/Database.pm 110;"
s
+Mojo::Redis::Database::_generate_bnb_method lib/Mojo/Redis/Database.pm
136;" s
+Mojo::Redis::Database::_generate_nb_method lib/Mojo/Redis/Database.pm
160;" s
+Mojo::Redis::Database::_generate_p_method lib/Mojo/Redis/Database.pm
171;" s
+Mojo::Redis::Database::_process_blpop lib/Mojo/Redis/Database.pm 183;"
s
+Mojo::Redis::Database::_process_brpop lib/Mojo/Redis/Database.pm 184;"
s
+Mojo::Redis::Database::_process_geopos lib/Mojo/Redis/Database.pm 182;"
s
+Mojo::Redis::Database::_process_hgetall lib/Mojo/Redis/Database.pm
185;" s
+Mojo::Redis::Database::_process_info_structured
lib/Mojo/Redis/Database.pm 187;" s
+Mojo::Redis::Database::_process_xread_structured
lib/Mojo/Redis/Database.pm 204;" s
+Mojo::Redis::Database::call lib/Mojo/Redis/Database.pm 59;" s
+Mojo::Redis::Database::call_p lib/Mojo/Redis/Database.pm 77;" s
+Mojo::Redis::Database::connection lib/Mojo/Redis/Database.pm 126;"
s
+Mojo::Redis::Database::discard lib/Mojo/Redis/Database.pm 90;" s
+Mojo::Redis::Database::discard_p lib/Mojo/Redis/Database.pm 92;"
s
+Mojo::Redis::Database::exec lib/Mojo/Redis/Database.pm 82;" s
+Mojo::Redis::Database::exec_p lib/Mojo/Redis/Database.pm 84;" s
+Mojo::Redis::Database::multi lib/Mojo/Redis/Database.pm 98;" s
+Mojo::Redis::Database::multi_p lib/Mojo/Redis/Database.pm 103;" s
+Mojo::Redis::PubSub lib/Mojo/Redis/PubSub.pm 1;" p
+Mojo::Redis::PubSub::DEBUG lib/Mojo/Redis/PubSub.pm 6;" c
+Mojo::Redis::PubSub::_keyspace_key lib/Mojo/Redis/PubSub.pm 65;"
s
+Mojo::Redis::PubSub::_listen lib/Mojo/Redis/PubSub.pm 77;" s
+Mojo::Redis::PubSub::_reconnect lib/Mojo/Redis/PubSub.pm 107;"
s
+Mojo::Redis::PubSub::channels_p lib/Mojo/Redis/PubSub.pm 13;"
s
+Mojo::Redis::PubSub::json lib/Mojo/Redis/PubSub.pm 17;" s
+Mojo::Redis::PubSub::keyspace_listen lib/Mojo/Redis/PubSub.pm 19;"
s
+Mojo::Redis::PubSub::keyspace_unlisten lib/Mojo/Redis/PubSub.pm 24;"
s
+Mojo::Redis::PubSub::listen lib/Mojo/Redis/PubSub.pm 29;" s
+Mojo::Redis::PubSub::notify lib/Mojo/Redis/PubSub.pm 38;" s
+Mojo::Redis::PubSub::numpat_p lib/Mojo/Redis/PubSub.pm 48;" s
+Mojo::Redis::PubSub::numsub_p lib/Mojo/Redis/PubSub.pm 44;" s
+Mojo::Redis::PubSub::unlisten lib/Mojo/Redis/PubSub.pm 52;" s
+Mojo::Redis::_blocking_connection lib/Mojo/Redis.pm 61;" s
+Mojo::Redis::_connection lib/Mojo/Redis.pm 45;" s
+Mojo::Redis::_dequeue lib/Mojo/Redis.pm 72;" s
+Mojo::Redis::_enqueue lib/Mojo/Redis.pm 82;" s
+Mojo::Redis::_fork_safety lib/Mojo/Redis.pm 89;" s
+Mojo::Redis::cache lib/Mojo/Redis.pm 33;" s
+Mojo::Redis::cursor lib/Mojo/Redis.pm 34;" s
+Mojo::Redis::db lib/Mojo/Redis.pm 35;" s
+Mojo::Redis::new lib/Mojo/Redis.pm 37;" s
+OFFLINE lib/Mojo/Redis/Cache.pm 10;" c
+SENTINELS_CONNECT_TIMEOUT lib/Mojo/Redis/Connection.pm 10;" c
+_add_method lib/Mojo/Redis/Database.pm 110;" s
+_blocking_connection lib/Mojo/Redis.pm 61;" s
+_compute_p lib/Mojo/Redis/Cache.pm 48;" s
+_connect lib/Mojo/Redis/Connection.pm 55;" s
+_connect_args lib/Mojo/Redis/Connection.pm 94;" s
+_connection lib/Mojo/Redis.pm 45;" s
+_dequeue lib/Mojo/Redis.pm 72;" s
+_discover_master lib/Mojo/Redis/Connection.pm 109;" s
+_encode lib/Mojo/Redis/Connection.pm 47;" s
+_enqueue lib/Mojo/Redis.pm 82;" s
+_fork_safety lib/Mojo/Redis.pm 89;" s
+_generate_bnb_method lib/Mojo/Redis/Database.pm 136;" s
+_generate_nb_method lib/Mojo/Redis/Database.pm 160;" s
+_generate_p_method lib/Mojo/Redis/Database.pm 171;" s
+_id lib/Mojo/Redis/Connection.pm 147;" s
+_is_blocking lib/Mojo/Redis/Connection.pm 149;" s
+_keyspace_key lib/Mojo/Redis/PubSub.pm 65;" s
+_listen lib/Mojo/Redis/PubSub.pm 77;" s
+_maybe_compute_p lib/Mojo/Redis/Cache.pm 64;" s
+_next_p lib/Mojo/Redis/Cursor.pm 107;" s
+_offline_connection lib/Mojo/Redis/Cache.pm 87;" s
+_on_close_cb lib/Mojo/Redis/Connection.pm 151;" s
+_on_read_cb lib/Mojo/Redis/Connection.pm 166;" s
+_parse_message_cb lib/Mojo/Redis/Connection.pm 178;" s
+_process_blpop lib/Mojo/Redis/Database.pm 183;" s
+_process_brpop lib/Mojo/Redis/Database.pm 184;" s
+_process_geopos lib/Mojo/Redis/Database.pm 182;" s
+_process_hgetall lib/Mojo/Redis/Cursor.pm 120;" s
+_process_hgetall lib/Mojo/Redis/Database.pm 185;" s
+_process_hkeys lib/Mojo/Redis/Cursor.pm 121;" s
+_process_hscan lib/Mojo/Redis/Cursor.pm 122;" s
+_process_info_structured lib/Mojo/Redis/Database.pm 187;" s
+_process_keys lib/Mojo/Redis/Cursor.pm 123;" s
+_process_scan lib/Mojo/Redis/Cursor.pm 124;" s
+_process_smembers lib/Mojo/Redis/Cursor.pm 125;" s
+_process_sscan lib/Mojo/Redis/Cursor.pm 126;" s
+_process_xread_structured lib/Mojo/Redis/Database.pm 204;" s
+_process_zscan lib/Mojo/Redis/Cursor.pm 127;" s
+_reconnect lib/Mojo/Redis/PubSub.pm 107;" s
+_reject_queue lib/Mojo/Redis/Connection.pm 222;" s
+_time lib/Mojo/Redis/Cache.pm 114;" s
+_write lib/Mojo/Redis/Connection.pm 230;" s
+add_dummy_user examples/twitter.pl 102;" s
+again lib/Mojo/Redis/Cursor.pm 11;" s
+all lib/Mojo/Redis/Cursor.pm 18;" s
+all_p lib/Mojo/Redis/Cursor.pm 46;" s
+cache lib/Mojo/Redis.pm 33;" s
+call lib/Mojo/Redis/Database.pm 59;" s
+call_p lib/Mojo/Redis/Database.pm 77;" s
+channels_p lib/Mojo/Redis/PubSub.pm 13;" s
+command lib/Mojo/Redis/Cursor.pm 7;" s
+compute_p lib/Mojo/Redis/Cache.pm 24;" s
+connection lib/Mojo/Redis/Database.pm 126;" s
+cursor lib/Mojo/Redis.pm 34;" s
+db lib/Mojo/Redis.pm 35;" s
+discard lib/Mojo/Redis/Database.pm 90;" s
+discard_p lib/Mojo/Redis/Database.pm 92;" s
+disconnect lib/Mojo/Redis/Connection.pm 22;" s
+exec lib/Mojo/Redis/Database.pm 82;" s
+exec_p lib/Mojo/Redis/Database.pm 84;" s
+finished lib/Mojo/Redis/Cursor.pm 8;" s
+is_connected lib/Mojo/Redis/Connection.pm 30;" s
+json lib/Mojo/Redis/PubSub.pm 17;" s
+keyspace_listen lib/Mojo/Redis/PubSub.pm 19;" s
+keyspace_unlisten lib/Mojo/Redis/PubSub.pm 24;" s
+listen lib/Mojo/Redis/PubSub.pm 29;" s
+memoize_p lib/Mojo/Redis/Cache.pm 39;" s
+multi lib/Mojo/Redis/Database.pm 98;" s
+multi_p lib/Mojo/Redis/Database.pm 103;" s
+new lib/Mojo/Redis.pm 37;" s
+new lib/Mojo/Redis/Cursor.pm 86;" s
+next lib/Mojo/Redis/Cursor.pm 60;" s
+next_p lib/Mojo/Redis/Cursor.pm 81;" s
+notify lib/Mojo/Redis/PubSub.pm 38;" s
+numpat_p lib/Mojo/Redis/PubSub.pm 48;" s
+numsub_p lib/Mojo/Redis/PubSub.pm 44;" s
+unlisten lib/Mojo/Redis/PubSub.pm 52;" s
+write_p lib/Mojo/Redis/Cache.pm 93;" s
+write_p lib/Mojo/Redis/Connection.pm 32;" s
+write_q lib/Mojo/Redis/Connection.pm 40;" s
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/Changes new/Mojo-Redis-3.24/Changes
--- old/Mojo-Redis-3.19/Changes 2019-01-31 05:03:11.000000000 +0100
+++ new/Mojo-Redis-3.24/Changes 2019-05-07 17:25:50.000000000 +0200
@@ -1,5 +1,24 @@
Revision history for perl distribution Mojo-Redis
+3.24 2019-05-07T22:25:50+0700
+ - Fix PubSub->keyspace_listen() #42
+
+3.23 2019-05-04T21:12:25+0700
+ - Fix compatibility with Mojolicious 8.15 #46
+
+3.22 2019-04-24T12:32:18+0700
+ - Forgot to update protocol parser for Mojo::Redis::Cache after 3.21 #43
+ - Fix broken link in Mojo::Redis::Connection #44
+ Contributor: Mohammad S Anwar
+
+3.21 2019-04-16T09:58:44+0700
+ - Changed default protocol parser to Protocol::Redis::XS #43
+
+3.20 2019-04-04T10:31:03+0700
+ - Use Protocol::Redis::Faster instead of Protocol::Redis #38
+ - Only decode data from bulk string responses #40
+ - Fix allowing custom URL object with userinfo in constructor #41
+
3.19 2019-01-31T13:03:11+0900
- Add support for encoding and decoding of JSON messages in
Mojo::Redis::PubSub
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/MANIFEST new/Mojo-Redis-3.24/MANIFEST
--- old/Mojo-Redis-3.19/MANIFEST 2019-01-31 05:03:12.000000000 +0100
+++ new/Mojo-Redis-3.24/MANIFEST 2019-05-07 17:25:51.000000000 +0200
@@ -1,5 +1,6 @@
.perltidyrc
.travis.yml
+.vstags
Changes
cpanfile
examples/cache.pl
@@ -26,6 +27,7 @@
t/cursor.t
t/db.t
t/geo.t
+t/keyspace-listen.t
t/method-coverage.t
t/pipelining.t
t/pubsub-reconnect.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/META.json
new/Mojo-Redis-3.24/META.json
--- old/Mojo-Redis-3.19/META.json 2019-01-31 05:03:12.000000000 +0100
+++ new/Mojo-Redis-3.24/META.json 2019-05-07 17:25:51.000000000 +0200
@@ -31,7 +31,7 @@
"runtime" : {
"requires" : {
"Mojolicious" : "7.80",
- "Protocol::Redis" : "1.0006"
+ "Protocol::Redis::Faster" : "0.002"
}
},
"test" : {
@@ -52,6 +52,10 @@
"web" : "https://github.com/jhthorsen/mojo-redis"
}
},
- "version" : "3.19",
+ "version" : "3.24",
+ "x_contributors" : [
+ "Jan Henning Thorsen <[email protected]>",
+ "Dan Book <[email protected]>"
+ ],
"x_serialization_backend" : "JSON::PP version 2.97001"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/META.yml new/Mojo-Redis-3.24/META.yml
--- old/Mojo-Redis-3.19/META.yml 2019-01-31 05:03:12.000000000 +0100
+++ new/Mojo-Redis-3.24/META.yml 2019-05-07 17:25:51.000000000 +0200
@@ -19,10 +19,13 @@
- inc
requires:
Mojolicious: '7.80'
- Protocol::Redis: '1.0006'
+ Protocol::Redis::Faster: '0.002'
resources:
bugtracker: https://github.com/jhthorsen/mojo-redis/issues
homepage: https://github.com/jhthorsen/mojo-redis
repository: https://github.com/jhthorsen/mojo-redis.git
-version: '3.19'
+version: '3.24'
+x_contributors:
+ - 'Jan Henning Thorsen <[email protected]>'
+ - 'Dan Book <[email protected]>'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/Makefile.PL
new/Mojo-Redis-3.24/Makefile.PL
--- old/Mojo-Redis-3.19/Makefile.PL 2019-01-31 05:03:11.000000000 +0100
+++ new/Mojo-Redis-3.24/Makefile.PL 2019-05-07 17:25:50.000000000 +0200
@@ -1,4 +1,5 @@
# Generated by git-ship. See 'git-ship --man' for help or
https://github.com/jhthorsen/app-git-ship
+use utf8;
use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
NAME => 'Mojo::Redis',
@@ -15,7 +16,7 @@
,
PREREQ_PM => {
'Mojolicious' => '7.80',
- 'Protocol::Redis' => '1.0006'
+ 'Protocol::Redis::Faster' => '0.002'
}
,
META_MERGE => {
@@ -30,6 +31,11 @@
web => 'https://github.com/jhthorsen/mojo-redis',
},
},
+ 'x_contributors' => [
+ 'Jan Henning Thorsen <[email protected]>',
+ 'Dan Book <[email protected]>'
+]
+,
},
test => {TESTS => (-e 'META.yml' ? 't/*.t' : 't/*.t xt/*.t')},
);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/README.md
new/Mojo-Redis-3.24/README.md
--- old/Mojo-Redis-3.19/README.md 2019-01-31 05:03:11.000000000 +0100
+++ new/Mojo-Redis-3.24/README.md 2019-05-07 17:25:50.000000000 +0200
@@ -52,31 +52,6 @@
useful, annoying or if you simply find bugs. Feedback can also be sent to
`[email protected]`.
-# CAVEATS
-
-[Protocol::Redis::XS](https://metacpan.org/pod/Protocol::Redis::XS) is not the
default ["protocol"](#protocol) because it has some
-limitations:
-
-- Cannot handle binary data
-
- [Mojo::Redis::Cache](https://metacpan.org/pod/Mojo::Redis::Cache) uses
[Protocol::Redis](https://metacpan.org/pod/Protocol::Redis) for now, since
- [Protocol::Redis::XS](https://metacpan.org/pod/Protocol::Redis::XS) fail
to handle binary data.
-
- See
[https://github.com/dgl/protocol-redis-xs/issues/4](https://github.com/dgl/protocol-redis-xs/issues/4)
for more information.
-
-- Cannot handle multi bulk replies with depth higher than 2
-
- ["xread" in
Mojo::Redis::Database](https://metacpan.org/pod/Mojo::Redis::Database#xread)
and other Redis commands returns complex nested
- data structures with depth higher than two.
[Protocol::Redis::XS](https://metacpan.org/pod/Protocol::Redis::XS) is unable to
- handle these messages.
-
- See
[https://github.com/dgl/protocol-redis-xs/issues/5](https://github.com/dgl/protocol-redis-xs/issues/5)
for more information.
-
-If you experience any issues with
[Protocol::Redis::XS](https://metacpan.org/pod/Protocol::Redis::XS) then please
report
-them to
[https://github.com/dgl/protocol-redis-xs/issues](https://github.com/dgl/protocol-redis-xs/issues).
It is still the
-default ["protocol"](#protocol) though, since it is a lot faster than
[Protocol::Redis](https://metacpan.org/pod/Protocol::Redis)
-for most tasks.
-
# EVENTS
## connection
@@ -112,9 +87,8 @@
$str = $redis->protocol_class;
$redis = $redis->protocol_class("Protocol::Redis::XS");
-Default to [Protocol::Redis](https://metacpan.org/pod/Protocol::Redis). This
will be changed in the future, if we see a
-more stable version of an alternative to
[Protocol::Redis::XS](https://metacpan.org/pod/Protocol::Redis::XS). See
-["CAVEATS"](#caveats) for details.
+Default to [Protocol::Redis::XS](https://metacpan.org/pod/Protocol::Redis::XS)
if the optional module is available and at
+least version 0.06, or falls back to
[Protocol::Redis::Faster](https://metacpan.org/pod/Protocol::Redis::Faster).
## pubsub
@@ -162,9 +136,11 @@
Object constructor. Can coerce a string into a
[Mojo::URL](https://metacpan.org/pod/Mojo::URL) and set ["url"](#url)
if present.
-# AUTHOR
+# AUTHORS
+
+Jan Henning Thorsen - `[email protected]`
-Jan Henning Thorsen
+Dan Book - `[email protected]`
# COPYRIGHT AND LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/cpanfile new/Mojo-Redis-3.24/cpanfile
--- old/Mojo-Redis-3.19/cpanfile 2018-12-13 00:19:37.000000000 +0100
+++ new/Mojo-Redis-3.24/cpanfile 2019-04-04 05:26:26.000000000 +0200
@@ -1,5 +1,5 @@
# You can install this projct with curl -L http://cpanmin.us | perl -
https://github.com/jhthorsen/mojo-redis/archive/master.tar.gz
-requires "Mojolicious" => "7.80";
-requires "Protocol::Redis" => "1.0006";
+requires "Mojolicious" => "7.80";
+requires "Protocol::Redis::Faster" => "0.002";
test_requires "Test::More" => "0.88";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/lib/Mojo/Redis/Cache.pm
new/Mojo-Redis-3.24/lib/Mojo/Redis/Cache.pm
--- old/Mojo-Redis-3.19/lib/Mojo/Redis/Cache.pm 2019-01-31 04:38:30.000000000
+0100
+++ new/Mojo-Redis-3.24/lib/Mojo/Redis/Cache.pm 2019-04-24 07:30:37.000000000
+0200
@@ -2,7 +2,6 @@
use Mojo::Base -base;
use Mojo::JSON;
-use Protocol::Redis;
use Scalar::Util 'blessed';
use Storable ();
use Time::HiRes ();
@@ -10,9 +9,7 @@
use constant OFFLINE => $ENV{MOJO_REDIS_CACHE_OFFLINE};
has connection => sub {
- OFFLINE
- ? shift->_offline_connection
- : shift->redis->_dequeue->protocol(Protocol::Redis->new(api =>
1))->encoding(undef);
+ OFFLINE ? shift->_offline_connection :
shift->redis->_dequeue->encoding(undef);
};
has deserialize => sub { \&Storable::thaw };
has default_expire => 600;
@@ -108,7 +105,7 @@
'Mojo::Redis::Connection::Offline';
HERE
my $redis = shift->redis;
- return $c->new(protocol => $redis->protocol_class->new(api => 1), url =>
$redis->url);
+ return $c->new(url => $redis->url);
}
sub _time { Time::HiRes::time() }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/lib/Mojo/Redis/Connection.pm
new/Mojo-Redis-3.24/lib/Mojo/Redis/Connection.pm
--- old/Mojo-Redis-3.19/lib/Mojo/Redis/Connection.pm 2019-01-31
04:38:30.000000000 +0100
+++ new/Mojo-Redis-3.24/lib/Mojo/Redis/Connection.pm 2019-05-04
15:57:09.000000000 +0200
@@ -31,7 +31,7 @@
sub write_p {
my $self = shift;
- my $p = Mojo::Promise->new(ioloop => $self->ioloop);
+ my $p = Mojo::Promise->new->ioloop($self->ioloop);
$self->write_q(@_, $p);
$self->is_connected ? $self->_write : $self->_connect;
return $p;
@@ -200,7 +200,9 @@
return $err if defined $err;
push @res, $res;
}
- elsif ($encoding and defined $m->{data}) {
+
+ # Only bulk string replies can contain binary-safe encoded data
+ elsif ($m->{type} eq '$' and $encoding and defined $m->{data}) {
push @res, Mojo::Util::decode($encoding, $m->{data});
}
else {
@@ -251,7 +253,7 @@
my $conn = Mojo::Redis::Connection->new(
ioloop => Mojo::IOLoop->singleton,
- protocol => Protocol::Redis::XS->new(api => 1),
+ protocol => Protocol::Redis::Faster->new(api => 1),
url => Mojo::URL->new("redis://localhost"),
);
@@ -316,8 +318,8 @@
$protocol = $conn->protocol;
$conn = $conn->protocol(Protocol::Redis::XS->new(api => 1));
-Holds a protocol object, such as L<Protocol::Redis> that is used to generate
-and parse Redis messages.
+Holds a protocol object, such as L<Protocol::Redis::Faster> that is used to
+generate and parse Redis messages.
=head2 url
@@ -353,7 +355,7 @@
$conn = $conn->write_q(@command => @args, undef);
Will enqueue a Redis command and either resolve/reject the L<Mojo::Promise>
-or emit a L</error> or L</message> event when the Redis server responds.
+or emit a L</error> or L</response> event when the Redis server responds.
This method is EXPERIMENTAL and currently meant for internal use.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/lib/Mojo/Redis/Database.pm
new/Mojo-Redis-3.24/lib/Mojo/Redis/Database.pm
--- old/Mojo-Redis-3.19/lib/Mojo/Redis/Database.pm 2019-01-31
04:38:30.000000000 +0100
+++ new/Mojo-Redis-3.24/lib/Mojo/Redis/Database.pm 2019-05-04
16:11:06.000000000 +0200
@@ -101,9 +101,10 @@
}
sub multi_p {
- my $self = shift;
+ my ($self, @p) = @_;
$self->{txn} = 'default';
- return $self->connection->write_p('MULTI');
+ my $p = $self->connection->write_p('MULTI');
+ return @p ? $p->then(sub { Mojo::Promise->all(@p) }) : $p;
}
sub _add_method {
@@ -1078,11 +1079,22 @@
$res = $db->multi;
$db = $db->multi(sub { my ($db, $err, $res) = @_ });
$promise = $db->multi_p;
+ $promise = $db->multi_p(@promises);
Mark the start of a transaction block. Commands issued after L</multi> will
automatically be discarded if C<$db> goes out of scope. Need to call
L</exec> to commit the queued commands to Redis.
+When calling L</multi_p>, you can directly pass in the new instructions:
+
+ $db->multi_p(
+ $db->set_p("x:y:z" => 1011),
+ $db->get_p("x:y:z"),
+ $db->incr_p("x:y:z"),
+ $db->incrby_p("x:y:z" => -10),
+ )->then(sub {
+ });
+
See L<https://redis.io/commands/multi> for more information.
=head2 object
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/lib/Mojo/Redis/PubSub.pm
new/Mojo-Redis-3.24/lib/Mojo/Redis/PubSub.pm
--- old/Mojo-Redis-3.19/lib/Mojo/Redis/PubSub.pm 2019-01-31
04:58:00.000000000 +0100
+++ new/Mojo-Redis-3.24/lib/Mojo/Redis/PubSub.pm 2019-05-07
17:24:46.000000000 +0200
@@ -18,7 +18,9 @@
sub keyspace_listen {
my ($self, $cb) = (shift, pop);
- return $self->listen($self->_keyspace_key(@_), $cb);
+ my $key = $self->_keyspace_key(@_);
+ $self->{keyspace_listen}{$key} = 1;
+ return $self->listen($key, $cb);
}
sub keyspace_unlisten {
@@ -70,8 +72,8 @@
local $args->{op} = $_[1] // $args->{op} // '*';
local $args->{type} = $args->{type} || ($args->{key} eq '*' ? 'keyevent' :
'keyspace');
- return sprintf '__%s@%s__:%s %s', $args->{type}, $args->{db} //
$self->redis->url->path->[0] // '',
- $args->{type} eq 'keyevent' ? (@$args{qw(op key)}) : (@$args{qw(key op)});
+ return sprintf '__%s@%s__:%s', $args->{type}, $args->{db} //
$self->redis->url->path->[0] // '*',
+ $args->{type} eq 'keyevent' ? $args->{op} : $args->{key};
}
sub _listen {
@@ -93,7 +95,8 @@
my ($conn, $res) = @_; # $res = [$type, $name, $payload]
return unless ref $res eq 'ARRAY' and @$res >= 3;
$res->[2] = eval { from_json $res->[2] } if $self->{json}{$res->[1]};
- for my $cb (@{$self->{chans}{$res->[1]}}) { $self->$cb($res->[2]) }
+ my $keyspace_listen = $self->{keyspace_listen}{$res->[1]};
+ for my $cb (@{$self->{chans}{$res->[1]}}) { $self->$cb($keyspace_listen
? [@$res[2, 3]] : $res->[2]) }
}
);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/lib/Mojo/Redis.pm
new/Mojo-Redis-3.24/lib/Mojo/Redis.pm
--- old/Mojo-Redis-3.19/lib/Mojo/Redis.pm 2019-01-31 05:03:11.000000000
+0100
+++ new/Mojo-Redis-3.24/lib/Mojo/Redis.pm 2019-05-07 17:25:50.000000000
+0200
@@ -7,8 +7,9 @@
use Mojo::Redis::Cursor;
use Mojo::Redis::Database;
use Mojo::Redis::PubSub;
+use Scalar::Util 'blessed';
-our $VERSION = '3.19';
+our $VERSION = '3.24';
$ENV{MOJO_REDIS_URL} ||= 'redis://localhost:6379';
@@ -16,7 +17,9 @@
has max_connections => 5;
has protocol_class => do {
- my $class = $ENV{MOJO_REDIS_PROTOCOL} || 'Protocol::Redis';
+ my $class = $ENV{MOJO_REDIS_PROTOCOL};
+ $class ||= eval { require Protocol::Redis::XS;
Protocol::Redis::XS->VERSION('0.06'); 'Protocol::Redis::XS' };
+ $class ||= 'Protocol::Redis::Faster';
eval "require $class; 1" or die $@;
$class;
};
@@ -35,8 +38,10 @@
sub new {
my $class = shift;
- return $class->SUPER::new(url => Mojo::URL->new(shift), @_) if @_ % 2 and
ref $_[0] ne 'HASH';
- return $class->SUPER::new(@_);
+ return $class->SUPER::new(@_) unless @_ % 2 and ref $_[0] ne 'HASH';
+ my $url = shift;
+ $url = Mojo::URL->new($url) unless blessed $url and $url->isa('Mojo::URL');
+ return $class->SUPER::new(url => $url, @_);
}
sub _connection {
@@ -147,35 +152,6 @@
useful, annoying or if you simply find bugs. Feedback can also be sent to
C<[email protected]>.
-=head1 CAVEATS
-
-L<Protocol::Redis::XS> is not the default L</protocol> because it has some
-limitations:
-
-=over 2
-
-=item * Cannot handle binary data
-
-L<Mojo::Redis::Cache> uses L<Protocol::Redis> for now, since
-L<Protocol::Redis::XS> fail to handle binary data.
-
-See L<https://github.com/dgl/protocol-redis-xs/issues/4> for more information.
-
-=item * Cannot handle multi bulk replies with depth higher than 2
-
-L<Mojo::Redis::Database/xread> and other Redis commands returns complex nested
-data structures with depth higher than two. L<Protocol::Redis::XS> is unable to
-handle these messages.
-
-See L<https://github.com/dgl/protocol-redis-xs/issues/5> for more information.
-
-=back
-
-If you experience any issues with L<Protocol::Redis::XS> then please report
-them to L<https://github.com/dgl/protocol-redis-xs/issues>. It is still the
-default L</protocol> though, since it is a lot faster than L<Protocol::Redis>
-for most tasks.
-
=head1 EVENTS
=head2 connection
@@ -211,9 +187,8 @@
$str = $redis->protocol_class;
$redis = $redis->protocol_class("Protocol::Redis::XS");
-Default to L<Protocol::Redis>. This will be changed in the future, if we see a
-more stable version of an alternative to L<Protocol::Redis::XS>. See
-L</CAVEATS> for details.
+Default to L<Protocol::Redis::XS> if the optional module is available and at
+least version 0.06, or falls back to L<Protocol::Redis::Faster>.
=head2 pubsub
@@ -261,9 +236,11 @@
Object constructor. Can coerce a string into a L<Mojo::URL> and set L</url>
if present.
-=head1 AUTHOR
+=head1 AUTHORS
+
+Jan Henning Thorsen - C<[email protected]>
-Jan Henning Thorsen
+Dan Book - C<[email protected]>
=head1 COPYRIGHT AND LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/benchmark.t
new/Mojo-Redis-3.24/t/benchmark.t
--- old/Mojo-Redis-3.19/t/benchmark.t 2018-10-23 04:35:51.000000000 +0200
+++ new/Mojo-Redis-3.24/t/benchmark.t 2019-04-04 05:26:26.000000000 +0200
@@ -3,10 +3,10 @@
use Benchmark qw(cmpthese timeit timestr :hireswallclock);
plan skip_all => 'TEST_ONLINE=redis://localhost' unless $ENV{MOJO_REDIS_URL} =
$ENV{TEST_ONLINE};
-plan skip_all => 'TEST_BENCHMARK=500' unless my $n_times =
$ENV{TEST_BENCHMARK};
+plan skip_all => 'TEST_BENCHMARK=500' unless my $n_times =
$ENV{TEST_BENCHMARK};
my @classes = qw(Mojo::Redis Mojo::Redis2);
-my @protocols = qw(Protocol::Redis Protocol::Redis::XS);
+my @protocols = qw(Protocol::Redis Protocol::Redis::Faster
Protocol::Redis::XS);
my $key = "test:benchmark:$0";
my %t;
@@ -16,13 +16,18 @@
for my $protocol (@protocols) {
eval "require $protocol;1" or next;
my $redis = $class->new->protocol_class($protocol);
- my $name = sprintf '%s/%s', $class =~ /::(\w+)$/, $protocol =~ /XS/ ? 'XS'
: 'PP';
- run($name, $redis->isa('Mojo::Redis2') ? $redis : $redis->db);
+ my ($bm, $lrange) = run($redis->isa('Mojo::Redis2') ? $redis : $redis->db,
$protocol);
+ is_deeply $lrange, [reverse 0 .. $n_times - 1], sprintf '%s/%s %s', ref
$redis, $protocol, timestr $bm;
+
+ my $bm_key = join '/', $redis->isa('Mojo::Redis2') ? 'Redis2' : 'Redis',
+ $protocol =~ m!Protocol::Redis::(\w+)! ? $1 : 'PP';
+ $t{$bm_key} = $bm;
}
}
-compare(qw(Redis/PP Redis2/PP));
+compare(qw(Redis/Faster Redis2/Faster));
+compare(qw(Redis/Faster Redis/PP));
cmpthese(\%t) if $ENV{HARNESS_IS_VERBOSE};
done_testing;
@@ -34,11 +39,11 @@
}
sub run {
- my ($name, $db) = @_;
- my ($lpush, $lrange);
+ my $db = shift;
$db->del($key);
+ my ($lpush, $lrange);
my $i = 0;
my $bm = timeit(
$n_times,
@@ -49,7 +54,6 @@
);
$db->del($key);
- is_deeply $lrange, [reverse 0 .. $n_times - 1], sprintf 'lrange %s %s',
$name, timestr $bm;
- return $t{$name} = $bm;
+ return $bm, $lrange;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/cache.t
new/Mojo-Redis-3.24/t/cache.t
--- old/Mojo-Redis-3.19/t/cache.t 2018-12-17 11:03:21.000000000 +0100
+++ new/Mojo-Redis-3.24/t/cache.t 2019-04-24 07:30:37.000000000 +0200
@@ -9,9 +9,6 @@
my $n_computed = 0;
my $res;
-# Using Protocol::Redis::XS 0.05 does not work
-$cache->connection($redis->_dequeue) if $ENV{TEST_XS};
-
cleanup();
for my $i (1 .. 2) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/connection-sentinel.t
new/Mojo-Redis-3.24/t/connection-sentinel.t
--- old/Mojo-Redis-3.19/t/connection-sentinel.t 2018-10-23 04:35:51.000000000
+0200
+++ new/Mojo-Redis-3.24/t/connection-sentinel.t 2019-04-24 07:30:37.000000000
+0200
@@ -3,6 +3,7 @@
use Mojo::Redis;
my $port = Mojo::IOLoop::Server->generate_port;
+my $redis =
Mojo::Redis->new("redis://whatever:s3cret\@mymaster/12?sentinel=localhost:$port&sentinel=localhost:$port");
my $conn_n = 0;
my @messages;
@@ -10,7 +11,7 @@
{port => $port},
sub {
my ($loop, $stream) = @_;
- my $protocol = Protocol::Redis->new(api => 1);
+ my $protocol = $redis->protocol_class->new(api => 1);
my @res = ({type => '$', data => 'OK'});
push @res,
@@ -30,8 +31,7 @@
}
);
-my $redis =
Mojo::Redis->new("redis://whatever:s3cret\@mymaster/12?sentinel=localhost:$port&sentinel=localhost:$port");
-my $db = $redis->db;
+my $db = $redis->db;
$db->connection->_connect;
Mojo::IOLoop->start;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/keyspace-listen.t
new/Mojo-Redis-3.24/t/keyspace-listen.t
--- old/Mojo-Redis-3.19/t/keyspace-listen.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Mojo-Redis-3.24/t/keyspace-listen.t 2019-05-07 17:24:47.000000000
+0200
@@ -0,0 +1,55 @@
+use Mojo::Base -strict;
+use Test::More;
+use Mojo::Redis;
+
+my @events;
+my $redis = Mojo::Redis->new('redis://localhost');
+my $pubsub = $redis->pubsub;
+is $pubsub->_keyspace_key, '__keyevent@*__:*', 'keyevent default db wildcard';
+
+$redis->url->path->parse('/5');
+is $pubsub->_keyspace_key, '__keyevent@5__:*', 'keyevent default wildcard';
+is $pubsub->_keyspace_key({type => 'key*'}), '__key*@5__:*', 'keyboth wildcard
listen';
+is $pubsub->_keyspace_key(foo => undef), '__keyspace@5__:foo', 'keyspace foo';
+is $pubsub->_keyspace_key(undef, 'del'), '__keyevent@5__:del', 'keyevent del';
+is $pubsub->_keyspace_key('foo', 'rename', {db => 1, key => 'x', op => 'y'}),
'__keyspace@1__:foo',
+ 'keyspace foo and db';
+is $pubsub->_keyspace_key({db => 0, key => 'foo', type => 'key*'}),
'__key*@0__:foo', 'key* db and type';
+
+my $cb = $pubsub->keyspace_listen(undef, 'del', {db => 1}, sub { });
+is ref($cb), 'CODE', 'keyspace_listen returns callback';
+is_deeply $pubsub->{chans}{'__keyevent@1__:del'}, [$cb], 'callback is set up';
+is $pubsub->keyspace_unlisten(undef, 'del', {db => 1}, $cb), $pubsub,
'keyspace_unlisten with callback';
+ok !$pubsub->{chans}{'__keyevent@1__:del'}, 'callback is removed';
+$pubsub->{chans}{'__keyevent@1__:del'} = [$cb];
+is $pubsub->keyspace_unlisten(undef, 'del', {db => 1}), $pubsub,
'keyspace_unlisten without callback';
+ok !$pubsub->{chans}{'__keyevent@1__:del'}, 'callback is removed';
+
+if ($ENV{TEST_KEA}) {
+ my $redis = Mojo::Redis->new($ENV{TEST_ONLINE} || 'redis://localhost');
+ my $kea = $redis->db->config(qw(get notify-keyspace-events))->[1];
+ diag "config get notify-keyspace-events == $kea";
+ $redis->db->config(qw(set notify-keyspace-events KEA));
+
+ $redis->pubsub->keyspace_listen(\&gather);
+ $redis->pubsub->keyspace_listen({type => 'keyspace'}, \&gather);
+ Mojo::IOLoop->timer(0.15 => sub { Mojo::IOLoop->stop });
+ Mojo::IOLoop->start;
+
+ my $key = 'mojo:redis:test:keyspace:listen';
+ $redis->db->tap(set => $key => __FILE__)->del($key => __FILE__);
+ Mojo::IOLoop->start;
+ $redis->db->config(qw(set notify-keyspace-events), $kea);
+
+ ok + (grep { $_->[1] eq 'del' } @events), 'keyspace del event';
+ ok + (grep { $_->[1] eq 'set' } @events), 'keyspace set event';
+ ok + (grep { $_->[0] =~ /:set$/ } @events), 'keyevent set event';
+ ok + (grep { $_->[0] =~ /:del$/ } @events), 'keyevent del event';
+}
+
+done_testing;
+
+sub gather {
+ push @events, $_[1];
+ Mojo::IOLoop->stop if @events >= 4;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/pubsub-reconnect.t
new/Mojo-Redis-3.24/t/pubsub-reconnect.t
--- old/Mojo-Redis-3.19/t/pubsub-reconnect.t 2019-01-31 04:15:54.000000000
+0100
+++ new/Mojo-Redis-3.24/t/pubsub-reconnect.t 2019-02-08 10:00:38.000000000
+0100
@@ -7,7 +7,7 @@
my $redis = Mojo::Redis->new($ENV{TEST_ONLINE});
my $channel = "test:reconnect:$$";
my $expected_reconnects = 3;
-my ($pubsub_id, @before_connect, @disconnect, @payloads, @reconnect);
+my ($pubsub_id, @before_connect, @disconnect, @err, @payloads, @reconnect);
note 'setup pubsub';
my $pubsub = $redis->pubsub;
@@ -21,17 +21,26 @@
$pubsub->on(
before_connect => sub {
my ($pubsub, $conn) = @_;
- $conn->write_p(qw(CLIENT ID))->then(sub {
- $pubsub_id = shift;
- Mojo::IOLoop->timer(0.1 => sub { $pubsub->notify($channel => 'kill') });
- });
+ $conn->write_p(qw(CLIENT ID))->then(
+ sub {
+ $pubsub_id = shift;
+ Mojo::IOLoop->timer(0.1 => sub { $pubsub->notify($channel => 'kill')
});
+ },
+ sub {
+ @err = @_;
+ Mojo::IOLoop->stop;
+ }
+ );
}
);
note 'reconnect enabled';
$pubsub->listen($channel => \&gather);
$pubsub->listen("$channel:$_" => sub { }) for 1 .. 4;
+
Mojo::IOLoop->start;
+plan skip_all => "CLIENT ID: @err" if @err;
+
is_deeply \@payloads, [qw(kill reconnected) x $expected_reconnects], 'got
payloads';
is @before_connect, $expected_reconnects + 1, 'got before_connect events';
is @reconnect, $expected_reconnects, 'got reconnect events';
@@ -48,6 +57,7 @@
);
Mojo::IOLoop->timer(0.1 => sub { $pubsub->connection->disconnect });
Mojo::IOLoop->start;
+is_deeply \@err, [], 'no errors';
is @before_connect + @reconnect, 0, 'got no before_connect or reconnect
events';
is @disconnect, 1, 'got only disconnect event';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/pubsub.t
new/Mojo-Redis-3.24/t/pubsub.t
--- old/Mojo-Redis-3.19/t/pubsub.t 2019-01-31 04:56:54.000000000 +0100
+++ new/Mojo-Redis-3.24/t/pubsub.t 2019-05-05 10:49:46.000000000 +0200
@@ -52,27 +52,9 @@
delete $redis->{pubsub};
isnt $redis->db->connection, $conn, 'pubsub connection cannot be re-used';
-$redis = Mojo::Redis->new('redis://localhost/5');
-$pubsub = $redis->pubsub;
-is $pubsub->_keyspace_key, '__keyevent@5__:* *', 'keyevent default wildcard';
-is $pubsub->_keyspace_key({type => 'key*'}), '__key*@5__:* *', 'keyboth
wildcard listen';
-is $pubsub->_keyspace_key(foo => undef), '__keyspace@5__:foo *', 'keyspace
foo';
-is $pubsub->_keyspace_key(undef, 'del'), '__keyevent@5__:del *', 'keyevent
del';
-is $pubsub->_keyspace_key('foo', 'rename', {db => 1, key => 'x', op => 'y'}),
'__keyspace@1__:foo rename',
- 'keyspace foo rename and db';
-is $pubsub->_keyspace_key({db => 0, key => 'foo', type => 'key*'}),
'__key*@0__:foo *', 'key* db and type';
-
-my $cb = $pubsub->keyspace_listen(undef, 'del', {db => 1}, sub { });
-is ref($cb), 'CODE', 'keyspace_listen returns callback';
-is_deeply $pubsub->{chans}{'__keyevent@1__:del *'}, [$cb], 'callback is set
up';
-is $pubsub->keyspace_unlisten(undef, 'del', {db => 1}, $cb), $pubsub,
'keyspace_unlisten with callback';
-ok !$pubsub->{chans}{'__keyevent@1__:del *'}, 'callback is removed';
-$pubsub->{chans}{'__keyevent@1__:del *'} = [$cb];
-is $pubsub->keyspace_unlisten(undef, 'del', {db => 1}), $pubsub,
'keyspace_unlisten without callback';
-ok !$pubsub->{chans}{'__keyevent@1__:del *'}, 'callback is removed';
-
note 'test json data';
@messages = ();
+$pubsub = $redis->pubsub;
$pubsub->json("rtest:$$:1");
$pubsub->listen("rtest:$$:1" => \&gather);
Mojo::IOLoop->timer(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/redis.t
new/Mojo-Redis-3.24/t/redis.t
--- old/Mojo-Redis-3.19/t/redis.t 2019-01-31 04:38:30.000000000 +0100
+++ new/Mojo-Redis-3.24/t/redis.t 2019-04-16 04:45:17.000000000 +0200
@@ -1,18 +1,20 @@
use Mojo::Base -strict;
use Test::More;
use Mojo::Redis;
+use Mojo::URL;
my $redis = Mojo::Redis->new;
-is $redis->protocol_class, 'Protocol::Redis', 'connection_class';
-is $redis->max_connections, 5, 'max_connections';
-is $redis->url, 'redis://localhost:6379', 'default url';
+like $redis->protocol_class, qr{^Protocol::Redis}, 'connection_class';
+is $redis->max_connections, 5, 'max_connections';
+is $redis->url, 'redis://localhost:6379', 'default url';
$redis = Mojo::Redis->new('redis://redis.localhost', max_connections => 1);
is $redis->url, 'redis://redis.localhost', 'custom url';
is $redis->max_connections, 1, 'custom max_connections';
-$redis = Mojo::Redis->new(Mojo::URL->new('redis://redis.example.com'));
+$redis =
Mojo::Redis->new(Mojo::URL->new('redis://redis.example.com')->userinfo('x:foo'));
is $redis->url, 'redis://redis.example.com', 'custom url object';
+is $redis->url->userinfo, 'x:foo', 'userinfo retained';
$redis = Mojo::Redis->new({max_connections => 3});
is $redis->max_connections, 3, 'constructor with hash ref';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/txn.t new/Mojo-Redis-3.24/t/txn.t
--- old/Mojo-Redis-3.19/t/txn.t 2018-10-23 04:35:51.000000000 +0200
+++ new/Mojo-Redis-3.24/t/txn.t 2019-02-08 07:52:12.000000000 +0100
@@ -27,4 +27,8 @@
undef $db;
is $redis->db->get($key), 1012, 'rollback when $db goes out of scope';
+$db = $redis->db;
+$db->multi_p($db->set_p($key => 1011), $db->set_p($key),
$db->get_p($key))->catch(sub { @res = @_ })->wait;
+like $res[0], qr{^ERR}, "invalid command: @res";
+
done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-Redis-3.19/t/xread.t
new/Mojo-Redis-3.24/t/xread.t
--- old/Mojo-Redis-3.19/t/xread.t 2019-01-31 05:01:26.000000000 +0100
+++ new/Mojo-Redis-3.24/t/xread.t 2019-05-04 16:11:38.000000000 +0200
@@ -9,8 +9,6 @@
my $stream_name = "test:stream:$0";
my ($err, $len, $range, $read, $struct, @p);
-$redis->protocol_class($ENV{TEST_XS} ? 'Protocol::Redis::XS' :
'Protocol::Redis');
-
note 'Fresh start';
$db->del($stream_name);
@@ -25,7 +23,7 @@
Mojo::IOLoop->timer(
0.2 => sub {
my $db = $redis->db;
- Mojo::Promise->all(map { $db->xadd_p($stream_name, '*', xn => $_) } 11,
22)->finally(sub {
+ Mojo::Promise->all(map { $db->xadd_p($stream_name, '*', xn => $_) } 11,
22)->then(sub {
push @p, $db->xlen_p($stream_name)->then(sub { $len = shift });
push @p, $db->xrange_p($stream_name, '-', '+')->then(sub { $range =
shift });
return Mojo::Promise->all(@p);