Don't loop the example forever

This commit is contained in:
Asim 2015-11-28 20:08:41 +00:00
parent 69ee0e4738
commit 6177bc2313

View File

@ -121,36 +121,29 @@ func stream() {
func main() { func main() {
cmd.Init() cmd.Init()
// client.DefaultClient = client.NewClient( fmt.Println("\n--- Call example ---\n")
// client.Codec("application/pb", pb.Codec), for i := 0; i < 10; i++ {
// client.ContentType("application/pb"), call(i)
// )
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--- 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)
} }