Android GcmListenerService平行吗? [英] Android GcmListenerService parallel?

查看:96
本文介绍了Android GcmListenerService平行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GcmListenerService 并行或顺序处理 gcm 消息?我知道正常的 Android服务在主线程中运行。但是这也适用于 GcmListenerService

Does the GcmListenerService process the gcm messages in parallel or sequentially? I know that normal Android services run in the main thread. But does that also apply to GcmListenerService?

推荐答案

GcmListenerService处理消息在后台线程中并行执行,请参阅文档< a>该方法是异步调用的。因此,您可以在onMessageReceived()中执行阻止任务,而不必担心会阻止未来的消息。

GcmListenerService processes messages in parallel in background threads, see the note in the docs that methods are invoked asynchronously. So you are able to do blocking tasks in onMessageReceived() without worrying about blocking future messages.

这篇关于Android GcmListenerService平行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆