AutobahnAndroid Threading & Battery

#1

In my initial trials with AutobahnAndroid, I had some success. But I started to run into problems as I tried to complicate things. In particular, I wanted to move all operations into a Service, and ensure that the Handler ran with android.os.Process.BACKGROUND_THREAD priority, as the operations I need to run in the listeners (e.g., onTextMessage) can be blocking operations themselves.

I ran into a lot of issues with dead thread messages and closed connections. I wound up, until I get the service figured out, just creating a singleton that wraps up my WebSocketHandler, and gets stored in the Application class.

Any hints on getting a Service to work nicely with AutobahnAndroid?

Thanks!

Mark Andrachek, Jr.

mark.an...@gmail.com

0 Likes

#2

In my initial trials with AutobahnAndroid, I had some success. But I
started to run into problems as I tried to complicate things. In
particular, I wanted to move all operations into a Service, and ensure
that the Handler ran with android.os.Process.BACKGROUND_THREAD priority,
as the operations I need to run in the listeners (e.g., onTextMessage)
can be blocking operations themselves.

I ran into a lot of issues with dead thread messages and closed
connections. I wound up, until I get the service figured out, just
creating a singleton that wraps up my WebSocketHandler, and gets stored
in the Application class.

Any hints on getting a Service to work nicely with AutobahnAndroid?

No, sorry. There is no example. AutobahnAndroid should work on a background service. Do you have your code open-source/online somewhere to look at?

ยทยทยท

Am 29.04.2014 23:59, schrieb Mark Andrachek, Jr.:

Thanks!
Mark Andrachek, Jr.
mark.an...@gmail.com

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes