[#24] Client: Implement pool part2
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
c9a75ea025
commit
ee20798379
63 changed files with 801 additions and 526 deletions
|
@ -7,14 +7,13 @@ internal interface ISessionProvider
|
|||
ValueTask<Session.SessionToken> GetOrCreateSession(ISessionToken args, CallContext ctx);
|
||||
}
|
||||
|
||||
internal sealed class SessionProvider(EnvironmentContext envCtx)
|
||||
internal sealed class SessionProvider(ClientContext envCtx)
|
||||
{
|
||||
// TODO: implement cache for session in the next iteration
|
||||
public async ValueTask<Session.SessionToken> GetOrCreateSession(ISessionToken args, CallContext ctx)
|
||||
{
|
||||
if (args.SessionToken is null)
|
||||
{
|
||||
return await envCtx.Client.CreateSessionInternalAsync(new PrmSessionCreate(uint.MaxValue) { Context = ctx })
|
||||
return await envCtx.Client.CreateSessionInternalAsync(new PrmSessionCreate(uint.MaxValue, ctx))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue