mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
feat: add support for meta memcache commands (#4362)
This is a stripped down version of supporting the memcache meta requests. a. Not all meta flags are supported, but TTL, flags, arithmetics are supported. b. does not include reply support. c. does not include new semantics that are not part of the older, ascii protocol. The parser interface has not changed significantly, and the meta commands are emulated using the old, high level commands like ADD,REPLACE, INCR etc. See https://raw.githubusercontent.com/memcached/memcached/refs/heads/master/doc/protocol.txt for more details regarding the meta commands spec. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
6946820e56
commit
a27cce81b1
7 changed files with 291 additions and 22 deletions
21
tests/dragonfly/memcache_meta.py
Normal file
21
tests/dragonfly/memcache_meta.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from .instance import DflyInstance
|
||||
from . import dfly_args
|
||||
from meta_memcache import (
|
||||
Key,
|
||||
ServerAddress,
|
||||
CacheClient,
|
||||
connection_pool_factory_builder,
|
||||
)
|
||||
|
||||
DEFAULT_ARGS = {"memcached_port": 11211, "proactor_threads": 4}
|
||||
|
||||
|
||||
@dfly_args(DEFAULT_ARGS)
|
||||
def test_basic(df_server: DflyInstance):
|
||||
pool = CacheClient.cache_client_from_servers(
|
||||
servers=[
|
||||
ServerAddress(host="localhost", port=DEFAULT_ARGS.get("memcached_port")),
|
||||
],
|
||||
connection_pool_factory_fn=connection_pool_factory_builder(),
|
||||
)
|
||||
# TODO: to add integration tests
|
|
@ -5,7 +5,6 @@ from redis import Redis
|
|||
import socket
|
||||
import random
|
||||
import time
|
||||
import warnings
|
||||
|
||||
from . import dfly_args
|
||||
from .instance import DflyInstance
|
||||
|
|
|
@ -13,6 +13,7 @@ wrapt==1.14.1
|
|||
pytest-asyncio==0.20.1
|
||||
pytest-repeat==0.9.3
|
||||
pymemcache==4.0.0
|
||||
meta_memcache==2
|
||||
prometheus_client==0.17.0
|
||||
aiohttp==3.10.2
|
||||
numpy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue