You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2021/08/24 21:55:00 UTC

[couchdb-ioq] 07/07: Add ioq helper functions

This is an automated email from the ASF dual-hosted git repository.

chewbranca pushed a commit to branch ioq-per-shard-or-user
in repository https://gitbox.apache.org/repos/asf/couchdb-ioq.git

commit 55c8609d201c769090a948b98428ae416ebae56a
Author: Russell Branca <ch...@apache.org>
AuthorDate: Mon Aug 23 17:59:35 2021 -0700

    Add ioq helper functions
---
 src/ioq.erl | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/ioq.erl b/src/ioq.erl
index 2530dba..2448c43 100644
--- a/src/ioq.erl
+++ b/src/ioq.erl
@@ -22,6 +22,13 @@
     get_pid_for/1,
     set_pid_for/2
 ]).
+-export([
+    fd_pid/1,
+    ioq_pid/1,
+    cache/1
+]).
+
+-include_lib("ioq/include/ioq.hrl").
 
 -define(APPS, [config, folsom, couch_stats, ioq]).
 
@@ -94,3 +101,12 @@ get_pid_for(FdPid) ->
 set_pid_for(FdPid, IOQPid) ->
     ioq_opener:set_pid_for(FdPid, IOQPid).
 
+fd_pid(#ioq_file{fd=Fd}) ->
+    Fd.
+
+ioq_pid(#ioq_file{ioq=IOQ}) ->
+    IOQ.
+
+cache(#ioq_file{tab=Tab}) ->
+    Tab.
+