[GODRIVER-52] Implement Drivers Sessions API Created: 01/Aug/17 Updated: 28/Oct/23 Resolved: 24/Jul/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | CRUD |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.10 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Rathi Gnanasekaran | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Epic Link: | GODRIVER MongoDB 3.6 Server Support | ||||||||||||||||||||||||||||||||||||||||||||
| Comments |
| Comment by Githook User [ 24/Jul/18 ] | |||
|
Author: {'username': 'rfblue2', 'name': 'Roland Fong', 'email': 'rfblue2@gmail.com'}Message: Remove Drop option from collectionopt Change-Id: If6b6f70c2e40742ff7fa185f91e254e2d71f1517 | |||
| Comment by Githook User [ 24/Jul/18 ] | |||
|
Author: {'name': 'Roland Fong', 'email': 'rfblue2@gmail.com', 'username': 'rfblue2'}Message: Sessions test plan. Change-Id: I6a8bd4ffa33d478bf6df2974e963a6339622f3c0 | |||
| Comment by Githook User [ 24/Jul/18 ] | |||
|
Author: {'name': 'Roland Fong', 'email': 'rfblue2@gmail.com', 'username': 'rfblue2'}Message: Add Session Client Methods Change-Id: I4db2bbee2cb5105482c0a5d2182bd909af51c857 | |||
| Comment by Githook User [ 24/Jul/18 ] | |||
|
Author: {'name': 'Roland Fong', 'email': 'rfblue2@gmail.com', 'username': 'rfblue2'}Message: Add Mongo Session passable as an option Change-Id: I7e93694aea2d8407036b24e019f01ae59ef2e716 | |||
| Comment by Githook User [ 24/Jul/18 ] | |||
|
Author: {'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}Message: Implement sessions in core Change-Id: Ib3d60f531955a866f9b2c3fb58c5d12caff5681f | |||
| Comment by David Golden [ 09/Mar/18 ] | |||
|
Waiting on | |||
| Comment by David Golden [ 21/Jan/18 ] | |||
|
eliot suggests giving users session objects that satisfy the context.Context interface. That would allow users to pass them as the first argument to functions that take context as the first argument, which conveniently is what the Driver Sessions spec wants as well. I have some additional thoughts to consider before we implement. We have to think about composability of contexts. If a user has an existing context, we may want client.StartSession to have a WithContext(ctx) option to wrap an existing context instead of defaulting to context.Background(). Likewise, if a client has a session object satisfying context.Context and then wants to wrap it in some other context afterwards (e.g. a timeout), we need to let them do that in a way that doesn't prevent them from calling Session API methods. E.g. a user calling context.WithTimeout(session, time.Duration(2)*time.Second) winds up with a type that no longer allows calling session API methods. We could store a session as a context value (using context.WithValue()) and require users to explicitly extract it to call methods. This composes cleanly with other contexts, but is less elegant to read and may have some performance overhead to retrieve session values. Providing some sugar functions in a session package would make it much nicer to read/use. E.g.
That requires a sugar function taking a context object in the session package for every ClientSession API method described in the Drivers Sessions Spec. |