Segment_QueueConsumer::__construct PHP Метод

__construct() публичный Метод

Store our secret and options as part of this consumer
public __construct ( string $secret, array $options = [] )
$secret string
$options array
    public function __construct($secret, $options = array())
    {
        parent::__construct($secret, $options);
        if (isset($options["max_queue_size"])) {
            $this->max_queue_size = $options["max_queue_size"];
        }
        if (isset($options["batch_size"])) {
            $this->batch_size = $options["batch_size"];
        }
        $this->queue = array();
    }

Usage Example

Пример #1
0
 /**
  * Creates a new socket consumer for dispatching async requests immediately
  * @param string $secret
  * @param array  $options
  *     number   "timeout" - the timeout for connecting
  *     function "error_handler" - function called back on errors.
  *     boolean  "debug" - whether to use debug output, wait for response.
  */
 public function __construct($secret, $options = array())
 {
     if (!isset($options["timeout"])) {
         $options["timeout"] = 5;
     }
     if (!isset($options["host"])) {
         $options["host"] = "api.segment.io";
     }
     parent::__construct($secret, $options);
 }
All Usage Examples Of Segment_QueueConsumer::__construct