SimplePie::set_timeout PHP Method

set_timeout() public method

This allows you to change the maximum time the feed's server to respond and send the feed back.
Since: 1.0 Beta 3
public set_timeout ( integer $timeout = 10 )
$timeout integer The maximum number of seconds to spend waiting to retrieve a feed.
    public function set_timeout($timeout = 10)
    {
        $this->timeout = (int) $timeout;
    }

Usage Example

 private function loadFromWebService()
 {
     $feed = new \SimplePie();
     $feed->set_feed_url($this->endPoint);
     $feed->set_cache_location(THELIA_ROOT . 'cache/feeds');
     $feed->init();
     $feed->handle_content_type();
     $feed->set_timeout(10);
     $this->data = $feed->get_items();
 }
All Usage Examples Of SimplePie::set_timeout