gRPC: Up and Running by Danesh Kuruppu & Kasun Indrasiri
Author:Danesh Kuruppu & Kasun Indrasiri [Danesh Kuruppu]
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2020-01-29T16:00:00+00:00
Example 5-5. gRPC deadlines for the client application
conn, err := grpc.Dial(address, grpc.WithInsecure()) if err != nil { log.Fatalf("did not connect: %v", err) } defer conn.Close() client := pb.NewOrderManagementClient(conn) clientDeadline := time.Now().Add( time.Duration(2 * time.Second)) ctx, cancel := context.WithDeadline( context.Background(), clientDeadline) defer cancel() // Add Order order1 := pb.Order{Id: "101", Items:[]string{"iPhone XS", "Mac Book Pro"}, Destination:"San Jose, CA", Price:2300.00} res, addErr := client.AddOrder(ctx, &order1) if addErr != nil { got := status.Code(addErr) log.Printf("Error Occured -> addOrder : , %v:", got) } else { log.Print("AddOrder Response -> ", res.Value) }
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Linux Device Driver Development Cookbook by Rodolfo Giometti(3935)
Embedded Programming with Modern C++ Cookbook by Igor Viarheichyk(3634)
Implementing Cellular IoT Solutions for Digital Transformation by Dennis McCain(3570)
Embedded Linux Development Using Yocto Project - Third Edition by Otavio Salvador & Daiane Angolini(3407)
TinyML Cookbook by Gian Marco Iodice(3338)
Simplifying 3D Printing with OpenSCAD by Colin Dow(2843)
TinyML Cookbook by Gian Marco Iodice & Ronan Naughton(2605)
Fusion 360 for Makers by Lydia Sloan Cline(2222)
Networking A Beginner's Guide by Bruce Hallberg(2210)
Hands-On Linux for Architects by Denis Salamanca(2053)
But How Do It Know? by J. Clark Scott(2033)
Computers For Seniors For Dummies by Nancy C. Muir(2003)
Raspberry Pi and MQTT Essentials by Dhairya Parikh(1954)
Arduino Project Handbook, Volume 2: 25 Simple Electronics Projects for Beginners by Geddes Mark(1952)
9781803246888-ENHANCING DEEP LEARNING WITH BAYESIAN INFERENCE by Unknown(1902)
Hack and HHVM by Owen Yamauchi(1884)
31 Days Before Your CompTIA A+ Exams (Shanette Luellen's Library) by Benjamin Patrick Conry(1863)
MicroPython Projects by Jacob Beningo(1741)
Hands-On Internet of Things with MQTT by Tim Pulver(1712)
