Trying to make Tracker::Scheduler work

I have written a short fvwmperl module to use Tracker::Scheduler. To show that the Scheduler works in the simplest way before I try to use it in other places. But it isn’t working, which means I’ve done something wrong.

Basically, when I start the module, “Starting…” shows up in ~/xsession_errors. But if my schedule command worked properly, then “Stopping…” would show up 2 seconds later. But it never does.

So, what am I doing wrong please? Using version 2.6.5 on Debian testing. Thanx.

[code]
#!/usr/bin/perl

use strict ;
use warnings ;

use lib fvwm-perllib dir;
use FVWM::Module ;
use FVWM::Tracker ;
use FVWM::Tracker::Scheduler ;

my $module = new FVWM::Module(
Name => ‘Notify’,
Debug => 0,
);

my $scheduler = $module->track(‘Scheduler’) ;

$module->debug(“Starting…”, 0) ;

$scheduler->schedule(2, sub {
$module->debug(“Stopping…”, 0) ;
$module->terminate ;
} ) ;

$module->event_loop ;[/code]

It does:

[Notify]: Starting... [Notify]: Stopping...
Btw. you don’t need FVWM::Tracker and FVWM::Tracker::Scheduler because it’s a subclass of FVWM::Module.

With this

#!/usr/bin/perl

use strict ;
use warnings ;

use lib `fvwm-perllib dir`;
use FVWM::Module ;

my $module = new FVWM::Module(
    Name => 'Notify',
    Debug => 2,
    );

my $scheduler = $module->track('Scheduler') ;

$module->debug("Starting...", 0) ;

$scheduler->schedule(2, sub { 
    $module->debug("Stopping...", 0) ;
    $module->terminate ;
    } ) ;

$module->event_loop ;[/code]
you get the following output][Notify]: sent [SET_MASK 0]
[Notify]: sent [SET_SYNC_MASK 0]
[Notify]: Starting...
[Notify]: sent [Schedule 2000 8097956 SendToModule Notify FVWM::Tracker::Scheduler alarm 1]
[Notify]: sent [NOP FINISHED STARTUP]
[Notify]: sent [SET_MASK 4194304]
[Notify]: got M_STRING [FVWM::Tracker::Scheduler alarm 1]
[Notify]: Stopping...[/code]

Have you put the module into /usr/lib/fvwm/2.6.5?

You can add a local module path to your config with [code]
ModulePath $[FVWM_USERDIR]/lib:+

Now make a folder lib under ~/.fvwm and copy the module into it. Restart FVWM and you have it. 8)

And don’t forget to set the module rights to 755.

– Thomas –

I have the module in ~/.fvwm/modules, but that folder is in the modulepath. I also have other modules in that folder that are working fine.

You amended my module. So I copied it exactly into a new file, chmod 755, and then started it via FvwmConsole, with xsession-errors output as below. I also added in a divider line to the output. And the lines below the divider show debug output after I stopped the module at 20 seconds - KillModule notify.pl.

I know the Schedule commands in my ~/.fvwm/config work fine. But appears my fvwm is not behaving as expected. Correct?

[code][Notify]: sent [SET_MASK 0]
[Notify]: sent [SET_SYNC_MASK 0]
[Notify]: Starting…
[Notify]: sent [Schedule 2000 8766028 SendToModule Notify FVWM::Tracker::Scheduler alarm 1]
[Notify]: sent [NOP FINISHED STARTUP]
[Notify]: sent [SET_MASK 4194304]

[Notify]: sent [Deschedule 8766028]
[Notify]: Failed send [Deschedule 8766028]
[Notify]: sent [Nop] FINISH[/code]

It looks like …
I think you should ask on the FVWM mailing list what’s going wrong here.

Sorry that I cannot help with this issue :frowning:

– Thomas –

Yes, I will eventually post this to the ML. Thanks again.