Script Development / Connector Object DFF.CONN / Memcached
The Memcached Connector operation object primarily provides Memcached operation methods.
The DFF.CONN(...) parameters are as follows:
| Parameter | Type | Required / Default | Description |
|---|---|---|---|
connector_id |
str | Required | Connector ID |
.query(...)
Calls the specified method in the python-memcached client. .query(...) is an alias of .run(...), and command names are case-insensitive.
| Parameter | Type | Required / Default | Description |
|---|---|---|---|
command |
str | Required | The python-memcached client method name, e.g., GET, SET |
*args |
- | - | Positional arguments passed to the client method |
**kwargs |
- | - | Named arguments passed to the client method |
| Example | |
|---|---|
1 2 3 | |
The return value is consistent with the corresponding python-memcached client method.
Convenience Methods
The Connector also provides the following convenience methods:
| Method | Description |
|---|---|
.get(key) |
Gets the value of a key |
.set(key, value) |
Sets the value of a key |
.add(key, value) |
Sets only if the key does not exist |
.replace(key, value) |
Replaces only if the key exists |
.delete(key) |
Deletes a key |
These methods all call .run(...) internally, and their return values match the corresponding python-memcached methods. When you need to pass additional parameters such as expiration time, you can use .query(...) or .run(...) to directly call the client method.