PgBackendThread
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Reports whether code runs on the PostgreSQL backend thread inside a callback, the only place PostgreSQL may be called.
public static class PgBackendThreadAnkus checks this itself before every call into PostgreSQL, as pgrx’s guards do. Use these members when code is about to rely on that thread for something Ankus doesn’t check, such as handing a backend-only object to other code.
Inheritance: object
Methods
Section titled “Methods”AssertActive()
Section titled “AssertActive()”Throws unless the calling thread is the backend thread inside an active PostgreSQL callback, as pgrx’s
assert_active_thread() panics.
public static void AssertActive()Exceptions:
- InvalidOperationException: The calling thread is another thread, or no callback is active.
Properties
Section titled “Properties”IsActive
Section titled “IsActive”Gets whether the calling thread is the backend thread inside an active PostgreSQL callback.
public static bool IsActive { get; }Value: bool