We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89aaf0e commit ccac829Copy full SHA for ccac829
lua/java-core/utils/async.lua
@@ -116,6 +116,16 @@ local await_handle_error = function(defer)
116
return value
117
end
118
119
+local await_handle_ok = function(defer)
120
+ local ok, value = co.yield(defer)
121
+
122
+ if not ok then
123
+ error(value)
124
+ end
125
126
+ return value
127
+end
128
129
local await_all = function(defer)
130
assert(type(defer) == 'table', 'type error :: expected table')
131
return co.yield(join(defer))
@@ -124,6 +134,7 @@ end
134
return {
135
sync = async,
136
wait_handle_error = await_handle_error,
137
+ wait_handle_ok = await_handle_ok,
138
wait = await,
139
wait_all = await_all,
140
wrap = wrap,
0 commit comments