Menu

Callback methods aren't called

2011-07-01
2013-04-26
  • Hiroko Sakaguchi

    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

     
  • Yves YANG

    Yves YANG - 2011-07-06

    Have you a test-case, which is helpful to reproduce the problem?

     
  • Yves YANG

    Yves YANG - 2011-07-07

    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);
    }

     
  • Hiroko Sakaguchi

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.