/// <summary> /// Resume (continue) prior client session with FASTER using advanced functions; used during recovery from failure. /// For performance reasons this overload is not recommended if functions is value type (struct). /// </summary> /// <param name="functions">Callback functions</param> /// <param name="sessionId">ID/name of previous session to resume</param> /// <param name="commitPoint">Prior commit point of durability for session</param> /// <param name="threadAffinitized">For advanced users. Specifies whether session holds the thread epoch across calls. Do not use with async code. /// Ensure thread calls session Refresh periodically to move the system epoch forward.</param> /// <param name="sessionVariableLengthStructSettings">Session-specific variable-length struct settings</param> /// <returns>Session instance</returns> public AdvancedClientSession <Key, Value, Input, Output, Context, IAdvancedFunctions <Key, Value, Input, Output, Context> > ResumeSession <Input, Output, Context>(IAdvancedFunctions <Key, Value, Input, Output, Context> functions, string sessionId, out CommitPoint commitPoint, bool threadAffinitized = false, SessionVariableLengthStructSettings <Value, Input> sessionVariableLengthStructSettings = null) { return(ResumeAdvancedSession <Input, Output, Context, IAdvancedFunctions <Key, Value, Input, Output, Context> >(functions, sessionId, out commitPoint, threadAffinitized, sessionVariableLengthStructSettings)); }
/// <summary> /// Helper method to specify callback function instance along with Input, Output and Context types for advanced client sessions /// </summary> /// <typeparam name="Input"></typeparam> /// <typeparam name="Output"></typeparam> /// <typeparam name="Context"></typeparam> /// <returns></returns> public AdvancedClientSessionBuilder <Input, Output, Context> For <Input, Output, Context>(IAdvancedFunctions <Key, Value, Input, Output, Context> functions) { return(new AdvancedClientSessionBuilder <Input, Output, Context>(this, functions)); }
/// <summary> /// Start a new advanced client session with FASTER. /// For performance reasons, please use FasterKV<Key, Value>.For(functions).NewSession<Functions>(...) instead of this overload. /// </summary> /// <param name="functions">Callback functions</param> /// <param name="sessionId">ID/name of session (auto-generated if not provided)</param> /// <param name="threadAffinitized">For advanced users. Specifies whether session holds the thread epoch across calls. Do not use with async code. /// Ensure thread calls session Refresh periodically to move the system epoch forward.</param> /// <param name="sessionVariableLengthStructSettings">Session-specific variable-length struct settings</param> /// <returns>Session instance</returns> public AdvancedClientSession <Key, Value, Input, Output, Context, IAdvancedFunctions <Key, Value, Input, Output, Context> > NewSession <Input, Output, Context>(IAdvancedFunctions <Key, Value, Input, Output, Context> functions, string sessionId = null, bool threadAffinitized = false, SessionVariableLengthStructSettings <Value, Input> sessionVariableLengthStructSettings = null) { return(NewAdvancedSession <Input, Output, Context, IAdvancedFunctions <Key, Value, Input, Output, Context> >(functions, sessionId, threadAffinitized, sessionVariableLengthStructSettings)); }
internal AdvancedClientSessionBuilder(FasterKV <Key, Value> fasterKV, IAdvancedFunctions <Key, Value, Input, Output, Context> functions) { _fasterKV = fasterKV; _functions = functions; }