Closed bincxz closed 5 years ago
Where the app freeze Don't know whether is caused by the method....
I have the same problem as you. Have you solved it now? @codingtomato
I have the same problem as you. Have you solved it now? @codingtomato
还没。。。作者好像没维护这个项目了。。
I have the same problem as you. Have you solved it now? @codingtomato
还没。。。作者好像没维护这个项目了。。
崩的一塌糊涂,我是采用阿里云的方案。你MQ连接是在主线程吗 ?
I have the same problem as you. Have you solved it now? @codingtomato
还没。。。作者好像没维护这个项目了。。
崩的一塌糊涂,我是采用阿里云的方案。你MQ连接是在主线程吗 ?
你们有解决这个问题么?我这边也是,在用instruments来调试的时候出现 spinning ,然后发现这行代码在主线程中占住卡死了。
你将MQ连接,数据回调都在同一个线程应该没有问题!发自我的iPhone------------------ Original ------------------From: 胡金友 notifications@github.comDate: Tue,Apr 23,2019 8:55 PMTo: novastone-media/MQTT-Client-Framework MQTT-Client-Framework@noreply.github.comCc: RiverRun ayzhangqiao@gmail.com, Comment comment@noreply.github.comSubject: Re: [novastone-media/MQTT-Client-Framework] How can I receive messagenot in Main Thread?? (#516)
I have the same problem as you. Have you solved it now? @codingtomato
还没。。。作者好像没维护这个项目了。。
崩的一塌糊涂,我是采用阿里云的方案。你MQ连接是在主线程吗 ?
你们有解决这个问题么?我这边也是,在用instruments来调试的时候出现 spinning ,然后发现这行代码在主线程中占住卡死了。
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/novastone-media/MQTT-Client-Framework","title":"novastone-media/MQTT-Client-Framework","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/novastone-media/MQTT-Client-Framework"}},"updates":{"snippets":[{"icon":"PERSON","message":"@JyHu in #516: \u003e \u003e \u003e I have the same problem as you. Have you solved it now? @codingtomato\r\n\u003e \u003e \r\n\u003e \u003e \r\n\u003e \u003e 还没。。。作者好像没维护这个项目了。。\r\n\u003e \r\n\u003e 崩的一塌糊涂,我是采用阿里云的方案。你MQ连接是在主线程吗 ?\r\n\r\n你们有解决这个问题么?我这边也是,在用instruments来调试的时候出现 spinning ,然后发现这行代码在主线程中占住卡死了。"}],"action":{"name":"View Issue","url":"https://github.com/novastone-media/MQTT-Client-Framework/issues/516#issuecomment-485790773"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/novastone-media/MQTT-Client-Framework/issues/516#issuecomment-485790773", "url": "https://github.com/novastone-media/MQTT-Client-Framework/issues/516#issuecomment-485790773", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
你将MQ连接,数据回调都在同一个线程应该没有问题!发自我的iPhone------------------ Original ------------------From: 胡金友 notifications@github.comDate: Tue,Apr 23,2019 8:55 PMTo: novastone-media/MQTT-Client-Framework MQTT-Client-Framework@noreply.github.comCc: RiverRun ayzhangqiao@gmail.com, Comment comment@noreply.github.comSubject: Re: [novastone-media/MQTT-Client-Framework] How can I receive messagenot in Main Thread?? (#516) I have the same problem as you. Have you solved it now? @codingtomato 还没。。。作者好像没维护这个项目了。。 崩的一塌糊涂,我是采用阿里云的方案。你MQ连接是在主线程吗 ? 你们有解决这个问题么?我这边也是,在用instruments来调试的时候出现 spinning ,然后发现这行代码在主线程中占住卡死了。 —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/novastone-media/MQTT-Client-Framework","title":"novastone-media/MQTT-Client-Framework","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"[https://github.com/novastone-media/MQTT-Client-Framework"}},"updates":{"snippets":[{"icon":"PERSON","message":"@JyHu](https://github.com/novastone-media/MQTT-Client-Framework%22%7D%7D,%22updates%22:%7B%22snippets%22:%5B%7B%22icon%22:%22PERSON%22,%22message%22:%22@JyHu) in #516: \u003e \u003e \u003e I have the same problem as you. Have you solved it now? @codingtomato\r\n\u003e \u003e \r\n\u003e \u003e \r\n\u003e \u003e 还没。。。作者好像没维护这个项目了。。\r\n\u003e \r\n\u003e 崩的一塌糊涂,我是采用阿里云的方案。你MQ连接是在主线程吗 ?\r\n\r\n你们有解决这个问题么?我这边也是,在用instruments来调试的时候出现 spinning ,然后发现这行代码在主线程中占住卡死了。"}],"action":{"name":"View Issue","url":"#516 (comment)"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "#516 (comment)", "url": "#516 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
貌似我发现了。。。这个作者支持了这个需求。。。只是不太友好。 我查了下源代码,发现可以设置,但是是需要在connect之后才能设置。
先用MQTTSessionManager对象发送一次connect,在之后调用如下方法即可。。。已测试OK self.manager.session.queue = session_queue; self.manager.session.transport.queue = session_transport_queue;
你将MQ连接,数据回调都在同一个线程应该没有问题!发自我的iPhone------------------ Original ------------------From: 胡金友 notifications@github.comDate: Tue,Apr 23,2019 8:55 PMTo: novastone-media/MQTT-Client-Framework MQTT-Client-Framework@noreply.github.comCc: RiverRun ayzhangqiao@gmail.com, Comment comment@noreply.github.comSubject: Re: [novastone-media/MQTT-Client-Framework] How can I receive messagenot in Main Thread?? (#516) I have the same problem as you. Have you solved it now? @codingtomato 还没。。。作者好像没维护这个项目了。。 崩的一塌糊涂,我是采用阿里云的方案。你MQ连接是在主线程吗 ? 你们有解决这个问题么?我这边也是,在用instruments来调试的时候出现 spinning ,然后发现这行代码在主线程中占住卡死了。 —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/novastone-media/MQTT-Client-Framework","title":"novastone-media/MQTT-Client-Framework","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"[https://github.com/novastone-media/MQTT-Client-Framework"}},"updates":{"snippets":[{"icon":"PERSON","message":"@JyHu](https://github.com/novastone-media/MQTT-Client-Framework%22%7D%7D,%22updates%22:%7B%22snippets%22:%5B%7B%22icon%22:%22PERSON%22,%22message%22:%22@JyHu) in #516: \u003e \u003e \u003e I have the same problem as you. Have you solved it now? @codingtomato\r\n\u003e \u003e \r\n\u003e \u003e \r\n\u003e \u003e 还没。。。作者好像没维护这个项目了。。\r\n\u003e \r\n\u003e 崩的一塌糊涂,我是采用阿里云的方案。你MQ连接是在主线程吗 ?\r\n\r\n你们有解决这个问题么?我这边也是,在用instruments来调试的时候出现 spinning ,然后发现这行代码在主线程中占住卡死了。"}],"action":{"name":"View Issue","url":"#516 (comment)"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "#516 (comment)", "url": "#516 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
貌似我发现了。。。这个作者支持了这个需求。。。只是不太友好。 我查了下源代码,发现可以设置,但是是需要在connect之后才能设置。
先用MQTTSessionManager对象发送一次connect,在之后调用如下方法即可。。。已测试OK self.manager.session.queue = session_queue; self.manager.session.transport.queue = session_transport_queue;
哈喽你好,你测试成功了吗?因为他这个连接是异步的,想问一下设置队列是在连接成功的回掉里面设置还是connect方法以后立马设置。 当然我使用两种方法都没有成功,如果能提供一下您的关键代码就更好了,感激不尽!! 这个问题已经困扰我很久了。。
MQTTSession
accepts queue
parameter, and you can pass background queue to not block main thread.
I have search for the issues and try many times. I have try to create session and subscribe the topics int other thread but always when new message come, it come back to the UI thread.
I have to move the message handler to other thread , because some times the following method will freeze the app .
looking for help.
Thanks very much