Results 1 to 2 of 2

Thread: Stopping an AMI

  1. #1
    alverson is offline Registered User
    Name: Dennis Alverson
    Organization: Braxton Technologies
    Project: Orbital Analysis
    Join Date
    Aug 2011
    Posts
    5

    Stopping an AMI

    Is there a way to stop an AMI that is already in progress before it completes? I am executing an AMI from a GUI client, and I would like to provide the user the ability to stop the operation.
    Dennis Alverson
    Braxton Technologies

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,445
    Hi Dennis,

    For various technical reasons, Ice does not provide a way to cancel a remote operation. This is something you would need to implement in an application-specific way.

    For example, one option would be to set a flag in your AMI callback to ignore the response. Of course, that wouldn't have any effect on what the server is doing.

    If the intent is to stop the activity in the server to avoid wasting compute resources, you should consider modifying the Slice definitions of long-running and/or compute-intensive operations to return a proxy with which the client can terminate the request:

    Code:
    interface Job
    {
        void cancel();
    };
    
    interface Server
    {
        Job* longRunningOperation();
    };
    I realize that what I'm proposing is quite a bit more complex than simply issuing an AMI request, since now you also have to deal with launching the task in the background, notifying the client when the task completes, and delivering the results. However, the simple fact is that only the server knows how to safely terminate a request.

    Regards,
    Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Server unexpectedly stopping TcpAcceptor
    By SimonMartin in forum Help Center
    Replies: 3
    Last Post: 06-15-2011, 03:41 PM
  2. Questions regarding to AMI
    By zaoliu in forum Help Center
    Replies: 10
    Last Post: 03-06-2008, 01:36 PM
  3. AMI or not AMI depending on slice args?
    By stepancheg in forum Help Center
    Replies: 2
    Last Post: 02-26-2008, 03:00 PM
  4. Help : AMI
    By mykael in forum Help Center
    Replies: 7
    Last Post: 06-22-2006, 12:23 PM
  5. Error when stopping an Ice-based Windows service
    By dwolfe5272 in forum Help Center
    Replies: 14
    Last Post: 06-30-2005, 03:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •