Skip to content

AddInShouldTerminate

Function : AddIn
AddInShouldTerminate - Check for termination condition.

#include <addin.h>
BOOL LNPUBLIC AddInShouldTerminate(
void);
Description :

AddInShouldTerminate should be called by a Domino server add-in task when it specifically needs to check for task termination requests from the Lotus Domino Server. Such requests are usually generated by the server administrator entering "quit" or "tell quit" at the Console. This function is only supported within the context of a server add-in.

To allow your addin task to respond to the Server's orders in a timely manner, this routine should be called during the operation of any of your functions that the Lotus Domino Server normally would regard as uninterruptable.
Typical examples include: a function that imports thousands of notes into a database, a function that makes extensive and extended use of another vendor's APIs, and any other I/O bound activities that are discovered while fine-tuning your application.

AddInIdle performs this operation automatically, so this function is only useful in loops that may take a long time to perform. In addition, to ensure that "tell quit" is processed properly and that a console operator does not have to wait for an extended period for a task to terminate, any other "delay" or "sleep" functions should limit delays to 1 to 5 seconds. Developers of server add-ins are responsible for checking the server status every 5 seconds to see if it is time to quit for every add-in. Using a single add-in task to do the checking and passing that info along to other processes is not sufficient as some process aren't responding to requests to dump memory or to terminate.

Parameters :

Output : (routine) - TRUE if the addin should terminate, FALSE if not.

Sample Usage :

               /* There might be serveral minutes worth of import    */
               /* activity initiated here and AddInShould Terminate()*/
               /* calls could be blended in amoung buffered I/O calls*/

                if(AddInShouldTerminate())
                    break;
See Also : AddInIdle