-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (24 loc) · 1.33 KB
/
Program.cs
File metadata and controls
32 lines (24 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Creates channel for connecting to PassKit server
// Single Connection (for testing only)
// var channel = GrpcConnection.GrpcConnection.ConnectWithPassKitServer();
// gRPC Connection Pooling
var loyaltyChannel = GrpcConnectionPool.GrpcConnectionPool.GetInstance().GetChannel(); // Get a connection from the pool
var couponChannel = GrpcConnectionPool.GrpcConnectionPool.GetInstance().GetChannel(); // Get a connection from the pool
var flightChannel = GrpcConnectionPool.GrpcConnectionPool.GetInstance().GetChannel(); // Get a connection from the pool
var ticketChannel = GrpcConnectionPool.GrpcConnectionPool.GetInstance().GetChannel(); // Get a connection from the pool
// Flight Quickstart
QuickstartFlightTickets.FlightTickets buildFlights = new();
buildFlights.QuickStart(flightChannel);
// Loyalty Quickstart
QuickstartLoyalty.Membership buildLoyalty = new();
buildLoyalty.Quickstart(loyaltyChannel);
// Coupons Quickstart
QuickstartCoupons.Coupons buildCoupons = new();
buildCoupons.Quickstart(couponChannel);
// Event Tickets Quickstart
QuickstartEventickets.EventTicket buildEventTickets = new();
buildEventTickets.QuickStart(ticketChannel);
// Cleanly close the connection pool
Console.WriteLine("Shutting down connection pool");
GrpcConnectionPool.GrpcConnectionPool.GetInstance().Shutdown();
Console.WriteLine("Connection pool shut down");