Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
How do edicts work? (Read 3975 times)
Philip Hellyer
Full Member
*
Offline



Posts: 7

How do edicts work?
Jun 07th, 2015, 8:40am
 
My edicts don't appear to be running. Maybe you know why...

The TB help file suggest that edicts should run on startup and then at intervals of approximately one hour, subject to the current implementation details.

Mine have only ever been run when the file is opened or TB is restarted. It's been a day and a half since I created test notes with this self-logging edict code:

Code:
$Text="" + date("today") + "\n" + $Text; 



It's been run exactly 3 times, each of which is when the file was opened. It doesn't seem to matter whether the note is modified, the file is saved, TB has been restarted, or any other thing that I thought to try.

Any thoughts as to why they've never run on their own?
Thanks!

Tinderbox 6.3.0 on OSX Mavericks 10.9.5
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: How do edicts work?
Reply #1 - Jun 7th, 2015, 11:07am
 
I'm not sighted as to the exact implementation rules. However, my understanding is the concept is they are for things you want checked occasionally but not often enough to merit the overhead of a rule. In that context, edicts are supposed to happen occasionally in the background and likely at varying periodicity (as other tasks like rules/agents get priority).
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Philip Hellyer
Full Member
*
Offline



Posts: 7

Re: How do edicts work?
Reply #2 - Jun 7th, 2015, 1:16pm
 
Thanks Mark! that matches with my understanding. Maybe the implementation hasn't caught up with the intention.

One of my tests is in a file that contains a single note with the above $Edict code, so is competing against 0 rules and 0 agents for priority. It also only seems to run when the file is opened.

I've discovered that edicts are listed on the Agents & Rules Inspector.

Oddly, the inspector is currently (at 18:12) saying that it was last updated 3 hours ago, while the $Text in my note says the last run was at 14:06 (at which time TB crashed and was restarted) But that may just be how the timestamp math works, because a few minutes ago (at 17:58) it said 2 hours ago.

@all: anyone had a different experience with edicts so far?
Back to top
 
 
WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: How do edicts work?
Reply #3 - Jun 8th, 2015, 3:43pm
 
Edicts currently run (a) when the document is opened, and (b) roughly once an hour. (I *think* edicts are suspended when the document is in the background, but I'm not entirely sure.)

Back to top
 
 
WWW   IP Logged
Philip Hellyer
Full Member
*
Offline



Posts: 7

Re: How do edicts work?
Reply #4 - Jun 9th, 2015, 4:13am
 
At this point, my edicts are showing as not having run for 36 hours. I started this experiment on the 5th, and since then I've spent several hours with Tinderbox as the active application, though not always working with the files that contain the edicts.

[Since this is starting to sound like a bug, I'll send you my minimal test file. Thanks!]
Back to top
 
 
WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: How do edicts work?
Reply #5 - Jun 9th, 2015, 12:49pm
 
Edicts *should* run hourly, but they don't in Tinderbox 6.3.0. That'll be fixed in the next release.

Also, remember that changes to $Text might not affect the selected note, since that note is "checked out" and Tinderbox gives priority to your changes.
Back to top
 
 
WWW   IP Logged
Philip Hellyer
Full Member
*
Offline



Posts: 7

Re: How do edicts work?
Reply #6 - Aug 3rd, 2015, 8:48am
 
The implementation has definitely improved in 6.3.1, thanks very much.

FYI, I'm still not seeing anything like hourly execution. Only two of the below were on the order of an hour, and both of those were an hour after opening the document.

The note with the edict isn't usually selected, so afaict I'm not stepping on my own toes. This behaviour is consistent regardless of whether it's a dedicated test document open in the background, or test note inside a frequently used document.

Here's the log of execution times:

02/08/2015 11:23
01/08/2015 19:22
31/07/2015 21:24      - (Id closed and then re-opened the laptop, and seems that edicts in all documents fired simultaneously, no idea why.)
31/07/2015 13:26      
30/07/2015 18:21      
30/07/2015 11:34      - an hour later
30/07/2015 10:34      - rebooted
30/07/2015 09:10      
29/07/2015 09:45      - an hour later
29/07/2015 08:39      - opened with 6.3.1


Tinderbox 6.3.1 on Mavericks 10.9.5
Back to top
 
 
WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: How do edicts work?
Reply #7 - Aug 4th, 2015, 3:28pm
 
I'm not sure about edicts in the background; I can check if you like.  Email me.

How are you logging the time when edicts run?
Back to top
 
 
WWW   IP Logged
Philip Hellyer
Full Member
*
Offline



Posts: 7

Re: How do edicts work?
Reply #8 - Aug 5th, 2015, 10:22am
 
The edict updates its own $Text, like this:
Code:
$Text="" + date("today") + "\n" + $Text; 



Since you pointed out (above) that there might be issues with the note text being 'checked out', I've pretty consistently made sure to select a different note after checking on the log.

The timestamps logged this way seem to be consistent with the timing of changes to my other edict-driven items.
Back to top
 
« Last Edit: Aug 5th, 2015, 10:24am by Philip Hellyer »  
WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: How do edicts work?
Reply #9 - Aug 6th, 2015, 10:37am
 
Well set up a test to check this. (Offhand, I dont know whether edicts ought to run when the computer is asleep. )
Back to top
 
 
WWW   IP Logged
Philip Hellyer
Full Member
*
Offline



Posts: 7

Re: How do edicts work?
Reply #10 - Aug 6th, 2015, 10:55am
 
This is on a laptop that is often in use for most of the day. I wouldn't expect edicts to run when the computer is asleep.

I might expect any 'overdue' edicts to run when it wakes up or Tinderbox becomes the frontmost application.

I do expect that 'roughly once an hour' corresponds to elapsed clock time, regardless of whether the Tinderbox document was in active use. (i.e. frontmost window in the frontmost application)

I'm not sure what my expectation would be for when Tinderbox isn't the frontmost application. Provided that it 'catches up' somehow, I might never notice.

Thanks for looking into this.
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print