Skip to content

Commit

Permalink
server: remove the Run helper (#92)
Browse files Browse the repository at this point in the history
This has no meaningful use to justify its existence in the API.

Updates #46.
  • Loading branch information
creachadair committed Mar 14, 2023
1 parent adef658 commit 15caece
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 107 deletions.
18 changes: 0 additions & 18 deletions server/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"log"

"github.com/creachadair/jrpc2"
"github.com/creachadair/jrpc2/channel"
"github.com/creachadair/jrpc2/handler"
"github.com/creachadair/jrpc2/server"
)
Expand Down Expand Up @@ -47,20 +46,3 @@ func (s Service) Finish(_ jrpc2.Assigner, stat jrpc2.ServerStatus) {
fmt.Printf("SERVICE FINISHED err=%v\n", stat.Err)
close(s.done)
}

func ExampleRun() {
done := make(chan struct{})
cch, sch := channel.Direct()
go server.Run(sch, Service{done}, nil)

cli := jrpc2.NewClient(cch, nil)
if _, err := cli.Call(context.Background(), "Hello", nil); err != nil {
log.Fatalf("Call failed: %v", err)
}
cli.Close()
<-done
// Output:
// SERVICE STARTED
// Hello human
// SERVICE FINISHED err=<nil>
}
25 changes: 0 additions & 25 deletions server/run.go

This file was deleted.

64 changes: 0 additions & 64 deletions server/run_test.go

This file was deleted.

0 comments on commit 15caece

Please sign in to comment.