Skip to content

Buffer writes not working as expected #78

Closed
@eduardosoliv

Description

@eduardosoliv

Memcached::OPT_BUFFER_WRITES
Enables or disables buffered I/O. Enabling buffered I/O causes storage commands to "buffer" instead of being sent. Any action that retrieves data causes this buffer to be sent to the remote connection. Quitting the connection or closing down the connection will also cause the buffered data to be pushed to the remote connection.

Type: boolean, default: FALSE.

@ http://php.net/manual/en/memcached.constants.php

$ php -a
Interactive shell

php > $m = new \Memcached(); $m->addServer('....', 11211);
php > $m->set('test1', 10);
php > var_dump($m->get('test1'));
int(10)
php > $m->setOption(\Memcached::OPT_BUFFER_WRITES, true);
php > $m->set('test2', 20);
php > var_dump($m->get('test2'));
bool(false)
php > var_dump($m->getResultMessage());
string(9) "NOT FOUND"

I don't understand why there isn't a method like flush buffers, is already implemented at libmemcached:

http://docs.libmemcached.org/memcached_flush_buffers.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions