1 /* 2 Copyright(C) 2016 Brazil 3 4 This library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 This library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with this library; if not, write to the Free Software 16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 module groonga_d.request_timer; 19 20 21 private static import groonga_d.groonga; 22 23 extern(C): 24 nothrow @nogc: 25 26 struct _grn_request_timer 27 { 28 extern (C): 29 void* user_data; 30 void* function (const (char)* request_id, uint request_id_size, double timeout, void* user_data) register_func; 31 void function (void* timer_id, void* user_data) unregister_func; 32 void function (void* user_data) fin_func; 33 } 34 35 alias grn_request_timer = ._grn_request_timer; 36 37 /* Multithreading unsafe. */ 38 39 //GRN_API 40 void grn_request_timer_set(grn_request_timer* timer); 41 42 /* Multithreading safety is depends on grn_request_timer. */ 43 44 //GRN_API 45 void* grn_request_timer_register(const (char)* request_id, uint request_id_size, double timeout); 46 /* Multithreading safety is depends on grn_request_timer. */ 47 48 //GRN_API 49 void grn_request_timer_unregister(void* timer_id); 50 51 //GRN_API 52 double grn_get_default_request_timeout(); 53 54 //GRN_API 55 void grn_set_default_request_timeout(double timeout);