Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect the service is started #3

Open
2math opened this issue Jun 14, 2021 · 1 comment
Open

Detect the service is started #3

2math opened this issue Jun 14, 2021 · 1 comment

Comments

@2math
Copy link

2math commented Jun 14, 2021

In general we can use AppClient.getData() from the app and see latest status.
Is it possible to query the AppClient and check if the service is running?

The problem is that if the code in the service callback has a problem and can not complete correct and update the status, then every time when you check from the app you will have a status that indicates running process.

For example if we have 3 statuses (UploadImages, UploadingImages and Idle). We want to start our service and upload the images only if current status is Idle. Then we send UploadImages to our service, the service starts uploading and changes it's status to UploadingImages. At this time there could be a problem and the service may stop here, then next time when you getData from the service will receive UploadingImages. Currently this status will remain until the app is force stopped and started again, then we will have null as response.

I'm surrounding my code with try catch and trying to close the service properly if something unpredictable happens, but still if is possible from the AppClient to check if the service is running will be great

@easazade
Copy link
Owner

@2math this seems like a good feature to have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants