Don't loop the example forever
This commit is contained in:
parent
69ee0e4738
commit
6177bc2313
@ -121,36 +121,29 @@ func stream() {
|
||||
func main() {
|
||||
cmd.Init()
|
||||
|
||||
// client.DefaultClient = client.NewClient(
|
||||
// client.Codec("application/pb", pb.Codec),
|
||||
// client.ContentType("application/pb"),
|
||||
// )
|
||||
for {
|
||||
fmt.Println("\n--- Call example ---\n")
|
||||
for i := 0; i < 10; i++ {
|
||||
call(i)
|
||||
}
|
||||
|
||||
fmt.Println("\n--- Streamer example ---\n")
|
||||
stream()
|
||||
|
||||
fmt.Println("\n--- Publisher example ---\n")
|
||||
pub()
|
||||
|
||||
fmt.Println("\n--- Wrapper example ---\n")
|
||||
|
||||
// Wrap the default client
|
||||
client.DefaultClient = logWrap(client.DefaultClient)
|
||||
|
||||
call(0)
|
||||
|
||||
// Wrap using client.Wrap option
|
||||
client.DefaultClient = client.NewClient(
|
||||
client.Wrap(traceWrap),
|
||||
client.Wrap(logWrap),
|
||||
)
|
||||
|
||||
call(1)
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
fmt.Println("\n--- Call example ---\n")
|
||||
for i := 0; i < 10; i++ {
|
||||
call(i)
|
||||
}
|
||||
|
||||
fmt.Println("\n--- Streamer example ---\n")
|
||||
stream()
|
||||
|
||||
fmt.Println("\n--- Publisher example ---\n")
|
||||
pub()
|
||||
|
||||
fmt.Println("\n--- Wrapper example ---\n")
|
||||
|
||||
// Wrap the default client
|
||||
client.DefaultClient = logWrap(client.DefaultClient)
|
||||
|
||||
call(0)
|
||||
|
||||
// Wrap using client.Wrap option
|
||||
client.DefaultClient = client.NewClient(
|
||||
client.Wrap(traceWrap),
|
||||
client.Wrap(logWrap),
|
||||
)
|
||||
|
||||
call(1)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user