pcp
[Top] [All Lists]

Re: pmServiceDiscoveryInterrupt() commit a8b87e2 et al.

To: Nathan Scott <nathans@xxxxxxxxxx>
Subject: Re: pmServiceDiscoveryInterrupt() commit a8b87e2 et al.
From: Dave Brolley <brolley@xxxxxxxxxx>
Date: Fri, 11 Jul 2014 15:36:47 -0400
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1543911711.7865026.1405028479709.JavaMail.zimbra@xxxxxxxxxx>
References: <20140619194444.3B03D58015@xxxxxxxx> <y0md2df8vse.fsf@xxxxxxxx> <53BC5248.5050100@xxxxxxxxxx> <256416707.6217487.1404883930815.JavaMail.zimbra@xxxxxxxxxx> <y0mpphe60bw.fsf@xxxxxxxx> <53BD8921.3000306@xxxxxxxxxx> <2109477330.6980142.1404945968324.JavaMail.zimbra@xxxxxxxxxx> <53BE9F30.7010106@xxxxxxxxxx> <1543911711.7865026.1405028479709.JavaMail.zimbra@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
On 07/10/2014 05:41 PM, Nathan Scott wrote:
Hmmm, OK.  The only other suggestion then would be to make it a more
general, and call it "flags" (where flags can go in/out of the API).
But thats a pretty ordinary approach too, really.

Oh, or could interrupted-ness be indicated via the return code?
No, the interrupted flag is intended to be set from the calling app in after calling the service discovery API (via signal handler, another thread, or some similar means) in order to interrupt the process.

Anyway, you make a decision - it seems nothing here is particularly
attractive, and you're in the best position to consider all of the
approaches - go ahead, pick one and run with it.
OK. The latest incarnation features a pointer to a bit mask for boolean global options and state, including the 'interrupted' bit and now also the 'resolve' bit. For non-boolean global options, we're back to using a string argument. The name of the function is __pmDiscoverServicesWithOptions. I think it best describes the enhancement compared to the existing pmDiscoverServices(1).

The commits below (brolley/dev in pcpfans) contain the changes. They also temporarily disable the -t or --timeout option pending a proper re-implementation.

Dave

-------------------------------------

commit 44e6d0f80e41d24c5c054e0b39e30114bd5c83be
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date:   Fri Jul 11 15:26:36 2014 -0400

    Don't catch SIGALRM in pmfind.c

commit 6531827861ac520ca041a8344b8a39feba4a111d
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date:   Fri Jul 11 15:14:54 2014 -0400

    Latest service discovery with options API attempt.

    Revert back to a string based API for non-boolean global options.
    Pointer to a bit mask of boolean options and state, including
    PM_SERVICE_DISCOVERY_INTERRUPTED
    PM_SERVICE_DISCOVERY_RESOLVE.
    This pointer may be NULL to indicate no flags are set.

This commit temporarily disables the global timeout option (-t, --timeout).

<Prev in Thread] Current Thread [Next in Thread>