summaryrefslogtreecommitdiff
path: root/watchdog.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-11-13 08:53:03 -0600
committerJeff Carr <[email protected]>2022-11-13 08:53:03 -0600
commit207cf7ea16f1da8fa9f893504d77a2856298cc22 (patch)
tree54d513b83ce797be75268f7d8867e0b01ab8f23e /watchdog.go
parented382bec55be25039e4dcf020d1512139855c9bb (diff)
Massive refactor to use go plugins. This is neat.
update README.md set xterm title. make os.Exit() default on window close add a toolkit.Widget to the node structure remove 'Greeter' symbol mapping scheme removed the testing greeter code plugins: attempt to load plugins in a sensible order andlabs/ui: working andlabs/ui plugin (andlabs2) buttons work in andlabs plugin TODO: re-implement non-plugin version for Windows mswindows doesn't support go plugins yet gocui: put the gocui console so file in the binary does a full init of gocui plugin Button() and Group() working very well with gogui cleanly exit gocui technically you can load two toolkits at the same time kinda both working at the same time. esoteric two working plugins at the same time give up working on two gui's at the same time this is fun, but _not interesting wow. this actually works. NewButton() from both toolkits examples: all the examples run again remove early helloplugin example buttonplugin example cmd code buttonplugin runs and ldd is minimum Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'watchdog.go')
-rw-r--r--watchdog.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/watchdog.go b/watchdog.go
new file mode 100644
index 0000000..29ac21a
--- /dev/null
+++ b/watchdog.go
@@ -0,0 +1,23 @@
+package gui
+
+import (
+ "log"
+ "time"
+)
+
+var watchtime time.Duration = 100 // in tenths of seconds
+
+/*
+ This program sits here.
+ If you exit here, the whole thing will os.Exit()
+
+ This goroutine can be used like a watchdog timer
+*/
+func Watchdog() {
+ var i = 1
+ for {
+ log.Println("watchdog timer is alive. give me something to do.", i, "debug =", Config.Debug.Debug)
+ i += 1
+ time.Sleep(watchtime * time.Second / 10)
+ }
+}