示例#1
0
 public static Session <S, E, P> Let <S, E, P, T>(this Session <S, E, P> session, out T variable, T value) where S : SessionType where E : SessionStack where P : ProtocolType
 {
     if (session is null)
     {
         throw new ArgumentNullException(nameof(session));
     }
     session.CallSimply();
     variable = value;
     return(session.Duplicate());
 }
示例#2
0
 public static Session <S, E, P> Wait <S, E, P>(this Session <S, E, P> session) where S : SessionType where E : SessionStack where P : ProtocolType
 {
     if (session is null)
     {
         throw new ArgumentNullException(nameof(session));
     }
     session.CallSimply();
     session.WaitForLastTask();
     return(session.Duplicate());
 }
示例#3
0
        public static async Task <Session <S, E, P> > Sync <S, E, P>(this Session <S, E, P> session) where S : SessionType where E : SessionStack where P : ProtocolType
        {
            if (session is null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            session.CallSimply();
            await session.AwaitLastTask();

            return(session.Duplicate());
        }