|
Memcache::addServer(PECL memcache >= 2.0.0) Memcache::addServer — Add a memcached server to connection pool Описание
bool Memcache::addServer
( string $host
[, int $port = 11211
[, bool $persistent
[, int $weight
[, int $timeout
[, int $retry_interval
[, bool $status
[, callback $failure_callback
[, int $timeoutms
]]]]]]]] )
Memcache::addServer() adds a server to the connection pool. The connection, which was opened using Memcache::addServer() will be automatically closed at the end of script execution, you can also close it manually with Memcache::close(). You can also use the memcache_add_server() function. When using this method (as opposed to Memcache::connect() and Memcache::pconnect()) the network connection is not established until actually needed. Thus there is no overhead in adding a large number of servers to the pool, even though they might not all be used. Failover may occur at any stage in any of the methods, as long as other servers are available the request the user won't notice. Any kind of socket or Memcached server level errors (except out-of-memory) may trigger the failover. Normal client errors such as adding an existing key will not trigger a failover.
Список параметров
Возвращаемые значенияВозвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки. Примеры
Пример #1 Memcache::addServer() example
<?php Смотрите также
|
|