diff options
Diffstat (limited to 'src/hub/src/spreadspace.org/sfive-hub/s5hub.go')
-rw-r--r-- | src/hub/src/spreadspace.org/sfive-hub/s5hub.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/hub/src/spreadspace.org/sfive-hub/s5hub.go b/src/hub/src/spreadspace.org/sfive-hub/s5hub.go index 370e209..c1802eb 100644 --- a/src/hub/src/spreadspace.org/sfive-hub/s5hub.go +++ b/src/hub/src/spreadspace.org/sfive-hub/s5hub.go @@ -4,13 +4,24 @@ import ( "fmt" "log" "spreadspace.org/sfive" + "sync" ) func main() { fmt.Printf("s5: Hello, world.\n") - server, err := sfive.NewSfiveServer() + server, err := sfive.NewServer("/tmp/sfive.sqlite") if err != nil { - log.Fatalf("failed to start S5: %v", err) + log.Fatalf("failed to initialize S5: %v", err) } - server.ListenAndServe() + defer server.Close() + + var wg sync.WaitGroup + + wg.Add(1) + go func() { + defer wg.Done() + server.ServePipe("/run/sfive/pipe") + }() + + wg.Wait() } |