Overview of agentidler:
- Category: Xgrid/Developer
- Supported Platforms: OS X Universal
- Programmer: Andrew Keller
- License: BSD
- Status: In progress and active, support available for all platforms
- Support Contact:
Currently, Xgrid does not support terminating or suspending an agent program when the agent computer becomes unavailable. On the other hand, all the information you need to figure this out exists on the agent machine. agentidler is an Objective-C source file that provides a set of functions that tell whether or not your Xgrid agent program should stop using processor power due to a person walking up to the computer.
This code also provides some of the command strings for an Xgrid controller so that you don't have to memorize them yourself. These commands provide functions such as reporting progress to the controller, restarting the task or job, and declaring an agent unusable for the task or job. All you have to do is print the strings to stdout.
This code should compile on any platform, however the majority of the functionality exists only on Mac OS X.
agentidler download (revision 16)
- agentidler_r16.zip (19 KB) (last updated 10/29/2008 at 23:20 ETC)
Even though the file is Objective-C and has Objective-C code, none of the functions require Objective-C in order to be invoked. This allows the header to be a standard C-style header, which means that you can use this code from C, and most of C's derivatives.
Function Functionality
As this code evolves, I think it would be cool to support as many platforms as possible. The following is a map of the functionality of this code versus the platform. Cross-platform refers to code that should run just fine on any platform, and the platform codes refer to code that was written specifically for that platform. For functions that aren't written for a particular platform, generic code is there so that the file will still compile and run as expected.
If you have any code to contribute that would further extend the abilities of this code, feel free to and I'll include them!
| Cross-platform | OS X | Midnight BSD | Win32 | |
| Retrieve Window Server idle time | x | |||
| Retrieve SuspendWhenNotIdle preference | x | |||
| Calculate app run time (seconds) | x |