[GODRIVER-372] Add a Ping method to the Client type Created: 20/Apr/18 Updated: 12/Sep/18 Resolved: 12/Sep/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | CRUD |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.14 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Kristofer Brandow (Inactive) | Assignee: | Mathew Robinson (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | Stitch, neweng, newgrad | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The Connect method of the Client type does not currently block since it just starts goroutines. There is a desire from users to be able to ensure that the Client has actually established a connection to a topology before using the Client in an application. The database/sql package's DB type has this exact method, so there is precedent for such a method. Add a Ping method to the Client type that selects a server and calls the ping command on it. |
| Comments |
| Comment by Githook User [ 12/Sep/18 ] |
|
Author: {'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}Message: |
| Comment by Kristofer Brandow (Inactive) [ 05/Sep/18 ] |
|
I think it's okay for ping to take a *readpref.ReadPref here. |
| Comment by Jeffrey Yemin [ 23/Apr/18 ] |
|
If we're going to do this, the method should optionally take a read preference since we don't know what server type the application actually needs (i.e. it might be a read-only app that just needs any secondary to be available). That's perhaps why most drivers just require applications to call RunCommand, which already takes a read preference, when they want to ping. |