I am using the ServiceManagementRest class and passing callbacks
to some methods since they are asynchronous operations.
However, every so often, it happens that the callback methods aren't called.
Here are the methods that I pass callbacks to them,
-createDeployment()
-updateDeploymentStatus()
-deleteDeployment()
-changeDeploymentConfiguration()
Are there any solutions on this issue?
Regards,
Hiroko
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We think there is a case that callback will not be called, but this case is not a bug. Suppose you are holding ServiceManagement instance in a thread, and you have invoke some methods with callback. But later the thread is terminated for some reason. So the ServiceManagement instance is killed, and no callback will be called in this case.
It is similar to following example, if the main is terminated, there will be no chance to invoke callback again.
main() {
ServiceManagement.createDeployment(callback);
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I checked my code again and found out that any methods aren't invoked with callback. Callback methods contains very simple codes like setting flags and parameters that prove the callback methods are called.
A thread that calls ServiceManagement waits until
a callback method is called. Therefore, the thread isn't terminated.
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using the ServiceManagementRest class and passing callbacks
to some methods since they are asynchronous operations.
However, every so often, it happens that the callback methods aren't called.
Here are the methods that I pass callbacks to them,
-createDeployment()
-updateDeploymentStatus()
-deleteDeployment()
-changeDeploymentConfiguration()
Are there any solutions on this issue?
Regards,
Hiroko
Have you a test-case, which is helpful to reproduce the problem?
We think there is a case that callback will not be called, but this case is not a bug. Suppose you are holding ServiceManagement instance in a thread, and you have invoke some methods with callback. But later the thread is terminated for some reason. So the ServiceManagement instance is killed, and no callback will be called in this case.
It is similar to following example, if the main is terminated, there will be no chance to invoke callback again.
main() {
ServiceManagement.createDeployment(callback);
}
Thank you for your replies.
I checked my code again and found out that any methods aren't invoked with callback. Callback methods contains very simple codes like setting flags and parameters that prove the callback methods are called.
A thread that calls ServiceManagement waits until
a callback method is called. Therefore, the thread isn't terminated.
Thank you