lib/async/redis/context/multi.rb in async-redis-0.2.0 vs lib/async/redis/context/multi.rb in async-redis-0.3.0
- old
+ new
@@ -1,7 +1,7 @@
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
-# and Huba Nagy
+# Copyright, 2018, by Huba Nagy.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -19,34 +19,34 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
require_relative 'nested'
+require_relative '../methods/strings'
+require_relative '../methods/keys'
+require_relative '../methods/lists'
+
module Async
module Redis
module Context
class Multi < Nested
+ include Methods::Strings
+ include Methods::Keys
+ include Methods::Lists
+
def initialize(pool, *args)
super(pool)
@connection.write_request(['MULTI'])
@connection.read_response
end
- def set(key, value)
- return send_command('SET', key, value)
- end
-
- def get(key)
- return send_command 'GET', key
- end
-
def execute
- return send_command 'EXEC'
+ return call 'EXEC'
end
def discard
- return send_command 'DISCARD'
+ return call 'DISCARD'
end
end
end
end
end