aioqzone-feed Messages¶
aioqzone-feed uses tylisten to dispatch and subscribte messages.
Feed Messages¶
- aioqzone_feed.message.feed.raw_feed = <tylisten.hookspec.static.StaticHookSpec object>¶
- 参数:
bid – Used to identify feed batch (tell from different calling).
feed – Used to pass a ref to the feed.
- 返回类型:
Any
- aioqzone_feed.message.feed.processed_feed = <tylisten.hookspec.static.StaticHookSpec object>¶
- 参数:
bid – Used to identify feed batch (tell from different calling).
feed – Used to pass the feed content.
- 返回类型:
Any
- aioqzone_feed.message.feed.stop_fetch = <tylisten.hookspec.static.StaticHookSpec object>¶
An async callback to determine if fetch should be stopped (after processing current batch).
- 返回类型:
bool
- class aioqzone_feed.message.feed.FeedApiEmitterMixin(*args, **kwds)¶
- feed_dropped¶
This emitter is triggered when a feed is dropped.
- feed_processed¶
This emitter is triggered when a feed is processed.
- feed_media_updated¶
This emitter is triggered when a feed’s media is updated.
- stop_fetch¶
This hook is used to determin whether a fetch should stop.
- ch_feed_notify¶
A future store serves as message notify channel.
- stop()¶
Clear future stores.
Heartbeat Messages¶
- aioqzone_feed.message.heartbeat.heartbeat_refresh = <tylisten.hookspec.static.StaticHookSpec object>¶
This message is emitted after a heartbeat succeeded and there are new feeds. Use this event to wait for all dispatch task to be finished, and send received feeds.
- 参数:
num – number of new feeds
- 返回类型:
Any
- aioqzone_feed.message.heartbeat.heartbeat_failed = <tylisten.hookspec.static.StaticHookSpec object>¶
This message is emitted when the heartbeat got an error.
- 参数:
exc – An exception object that can be used to determine the cause of the heartbeat failure.
- 返回类型:
Any
提示
Recommended handling strategy:
QzoneError
ifcode
= -3000: Login expired. Relogin is needed.ServerTimeoutError
/ClientResponseError
ifstatus
= 500: Qzone server buzy. Ignore it.
- class aioqzone_feed.message.heartbeat.HeartbeatEmitterMixin(*args, **kwds)¶
- hb_failed¶
This emitter is triggered when the heartbeat fails because of a exception.
- hb_refresh¶
This emitter is triggered after a heartbeat succeeded and there are new feeds. Use this event to wait for all dispatch task to be finished, and send received feeds.
- ch_heartbeat_notify¶
A future store serves as heartbeat channel.
- stop()¶
Clear future stores.