Rob Walker <[EMAIL PROTECTED]> writes:
> here is how "the big Q" does it.
>
> There are no daemons running, the windows 95 laptop is turned off.
> We turn it on to do checkbook stuffs, and start quicken. as soon as
> we start quicken, it says to us, via a popup, "such and so a
> transaction was scheduled to be run at such and so a time, would you
> like me to apply it now?"
The problem with this is that there are cases that people have already
discussed that require that the events be scheduled and run at a
particular time even if gnucash isn't running then then; they must be
asynchronous. Some of these events will be scheduled by gnucash, and
I also want to allow the user (or other apps) to schdule events. One
of the biggest implications is that we have to make sure that we have
all the synch/locking stuff worked out right, and this is dependent on
whether or not we want to allow multiple invocations of gnucash to be
running for a single user.
> no daemons, just ask about them upon startup again. or, we could
> have a "gnucash --run-job=1" in my crontab, which would wake up and
> run job number one at a specified time (it would add the stock data
> to my stock register) if it wasn't already running.
I'd rather see gnucash just register a job on shutdown with an
appropriate one-shot system scheduler (perhaps at, perhaps something
better) on shutdown at the time of the next pending event. The
command could be as simple as "gnucash --run-jobs" which would see if
another invocation was running, if so, signal that one to handle
pending jobs, otherwise do it itself.
If you wanted to do something yourself from a cronjob regularly,
bypassing gnucash's event mechanism, I'd like to support that too.
That would just require adequate synchronization/locking mechanisms.
Given those, I'd like the user to be able to do things like this if
they want. I don't want to force the user to gnucash's internal
mechanism if we don't have to in cases where they're more comfortable
with another approach.
>From their crontab:
# Pay the rent once a month.
15 14 1 * * gnucash gnucash --command "(my-send-rent-payment-func)"
# Download the day's transactions
15 14 1 * * gnucash gnucash --run-script talk-to-my-bank
Note that if we do get the locking/synchronization right, having both
of these launched at the same time just shouldn't be a problem.
Or perhaps an event from the command line:
$ echo gnucash --run-script pay-the-loan-sharks | at now + 2 hours
And then they can skip town, just in case.
--
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]