【发布时间】:2017-05-27 03:31:41
【问题描述】:
我正在尝试根据实时通知从服务器上的 getstream.io 获取单个活动并丰富它。
正如您在下面看到的,它返回 null 直到获取整页。
// Websockets fired. There is a new activity $id. Fetch and enrich:
// Get activity that begins with the new $id
$options = ['id_gte' => $id];
// PROBLEM: First call to get single item returns NULL
$feed->getActivities(0, 1, $options);
// Second call without conditions returns everything fine
$feed->getActivities(0, 15);
// The desired activity is now present in response
$feed->getActivities(0, 1, $options);
在基于 id 的过滤器可用于新消息之前,是否有更好的方法来处理此问题或特定时间延迟?
【问题讨论】:
标签: php getstream-io