Software /
code /
prosody
Comparison
util/promise.lua @ 12975:d10957394a3c
util: Prefix module imports with prosody namespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 17 Mar 2023 16:23:16 +0100 |
parent | 12750:c882d2460bb1 |
comparison
equal
deleted
inserted
replaced
12974:ba409c67353b | 12975:d10957394a3c |
---|---|
1 local promise_methods = {}; | 1 local promise_methods = {}; |
2 local promise_mt = { __name = "promise", __index = promise_methods }; | 2 local promise_mt = { __name = "promise", __index = promise_methods }; |
3 | 3 |
4 local xpcall = require "util.xpcall".xpcall; | 4 local xpcall = require "prosody.util.xpcall".xpcall; |
5 local unpack = table.unpack; | 5 local unpack = table.unpack; |
6 | 6 |
7 function promise_mt:__tostring() | 7 function promise_mt:__tostring() |
8 return "promise (" .. (self._state or "invalid") .. ")"; | 8 return "promise (" .. (self._state or "invalid") .. ")"; |
9 end | 9 end |