diff options
| author | ruki <[email protected]> | 2022-07-05 22:40:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-05 22:40:05 +0800 |
| commit | 61d5d3faef3360303c862a4db2e7101e17ac6aac (patch) | |
| tree | 494898ac8eea80f9b83be0723379bd40a1912ffe /xmake/modules/private/service/client.lua | |
| parent | 4ee209c6235385a6e2b4182cab870f14067a50d1 (diff) | |
add timeout
Diffstat (limited to 'xmake/modules/private/service/client.lua')
| -rw-r--r-- | xmake/modules/private/service/client.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/private/service/client.lua b/xmake/modules/private/service/client.lua index 437a10f8a..92330fec4 100644 --- a/xmake/modules/private/service/client.lua +++ b/xmake/modules/private/service/client.lua @@ -22,12 +22,21 @@ import("core.base.object") import("core.base.socket") import("core.base.scheduler") +import("private.service.client_config", {alias = "config"}) -- define module local client = client or object() -- init client function client:init() + + -- init timeout + self._TIMEOUT = config.get("timeout") or -1 +end + +-- get timeout +function client:timeout() + return self._TIMEOUT end -- parse host address |
