Search Results for

    Show / Hide Table of Contents

    Interface IObjectPool<T>

    Inherited Members
    System.IDisposable.Dispose()
    Namespace: FreeSql.Internal.ObjectPool
    Assembly: FreeSql.dll
    Syntax
    public interface IObjectPool<T> : IDisposable
    Type Parameters
    Name Description
    T

    Properties

    | Improve this Doc View Source

    IsAvailable

    是否可用

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

    Policy

    Declaration
    IPolicy<T> Policy { get; }
    Property Value
    Type Description
    IPolicy<T>
    | Improve this Doc View Source

    Statistics

    统计对象池中的对象

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

    StatisticsFullily

    统计对象池中的对象(完整)

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

    UnavailableException

    不可用错误

    Declaration
    Exception UnavailableException { get; }
    Property Value
    Type Description
    System.Exception
    | Improve this Doc View Source

    UnavailableTime

    不可用时间

    Declaration
    DateTime? UnavailableTime { get; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    Methods

    | Improve this Doc View Source

    Get(Nullable<TimeSpan>)

    获取资源

    Declaration
    Object<T> Get(TimeSpan? timeout = null)
    Parameters
    Type Name Description
    System.Nullable<System.TimeSpan> timeout

    超时

    Returns
    Type Description
    Object<T>
    | Improve this Doc View Source

    GetAsync()

    获取资源

    Declaration
    Task<Object<T>> GetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task<Object<T>>
    | Improve this Doc View Source

    Return(Object<T>, Boolean)

    使用完毕后,归还资源

    Declaration
    void Return(Object<T> obj, bool isReset = false)
    Parameters
    Type Name Description
    Object<T> obj

    对象

    System.Boolean isReset

    是否重新创建

    | Improve this Doc View Source

    SetUnavailable(Exception, DateTime)

    将对象池设置为不可用,后续 Get/GetAsync 均会报错,同时启动后台定时检查服务恢复可用

    Declaration
    bool SetUnavailable(Exception exception, DateTime lastGetTime)
    Parameters
    Type Name Description
    System.Exception exception
    System.DateTime lastGetTime
    Returns
    Type Description
    System.Boolean

    由【可用】变成【不可用】时返回true,否则返回false

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX