Search Results for

    Show / Hide Table of Contents

    Interface IPolicy<T>

    Namespace: FreeSql.Internal.ObjectPool
    Assembly: FreeSql.dll
    Syntax
    public interface IPolicy<T>
    Type Parameters
    Name Description
    T

    Properties

    | Improve this Doc View Source

    AsyncGetCapacity

    异步获取排队队列大小,小于等于0不生效

    Declaration
    int AsyncGetCapacity { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    CheckAvailableInterval

    后台定时检查可用性间隔秒数

    Declaration
    int CheckAvailableInterval { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    IdleTimeout

    空闲时间,获取时若超出,则重新创建

    Declaration
    TimeSpan IdleTimeout { get; set; }
    Property Value
    Type Description
    System.TimeSpan
    | Improve this Doc View Source

    IsAutoDisposeWithSystem

    监听 AppDomain.CurrentDomain.ProcessExit/Console.CancelKeyPress 事件自动释放

    Declaration
    bool IsAutoDisposeWithSystem { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsThrowGetTimeoutException

    获取超时后,是否抛出异常

    Declaration
    bool IsThrowGetTimeoutException { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Name

    名称

    Declaration
    string Name { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    PoolSize

    池容量

    Declaration
    int PoolSize { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    SyncGetTimeout

    默认获取超时设置

    Declaration
    TimeSpan SyncGetTimeout { get; set; }
    Property Value
    Type Description
    System.TimeSpan
    | Improve this Doc View Source

    Weight

    权重

    Declaration
    int Weight { get; set; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    OnAvailable()

    事件:可用时触发

    Declaration
    void OnAvailable()
    | Improve this Doc View Source

    OnCheckAvailable(Object<T>)

    检查可用性

    Declaration
    bool OnCheckAvailable(Object<T> obj)
    Parameters
    Type Name Description
    Object<T> obj

    资源对象

    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    OnCreate()

    对象池的对象被创建时

    Declaration
    T OnCreate()
    Returns
    Type Description
    T

    返回被创建的对象

    | Improve this Doc View Source

    OnDestroy(T)

    销毁对象

    Declaration
    void OnDestroy(T obj)
    Parameters
    Type Name Description
    T obj

    资源对象

    | Improve this Doc View Source

    OnGet(Object<T>)

    从对象池获取对象成功的时候触发,通过该方法统计或初始化对象

    Declaration
    void OnGet(Object<T> obj)
    Parameters
    Type Name Description
    Object<T> obj

    资源对象

    | Improve this Doc View Source

    OnGetAsync(Object<T>)

    从对象池获取对象成功的时候触发,通过该方法统计或初始化对象

    Declaration
    Task OnGetAsync(Object<T> obj)
    Parameters
    Type Name Description
    Object<T> obj

    资源对象

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    OnGetTimeout()

    从对象池获取对象超时的时候触发,通过该方法统计

    Declaration
    void OnGetTimeout()
    | Improve this Doc View Source

    OnReturn(Object<T>)

    归还对象给对象池的时候触发

    Declaration
    void OnReturn(Object<T> obj)
    Parameters
    Type Name Description
    Object<T> obj

    资源对象

    | Improve this Doc View Source

    OnUnavailable()

    事件:不可用时触发

    Declaration
    void OnUnavailable()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX