feat: async scraper
This commit is contained in:
parent
53562eb6a8
commit
a32fd396d3
12 changed files with 1527 additions and 474 deletions
25
lua/cp/async/init.lua
Normal file
25
lua/cp/async/init.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
local M = {}
|
||||
|
||||
local active_operation = nil
|
||||
|
||||
function M.start_contest_operation(operation_name)
|
||||
if active_operation then
|
||||
error(
|
||||
("Contest operation '%s' already active, cannot start '%s'"):format(
|
||||
active_operation,
|
||||
operation_name
|
||||
)
|
||||
)
|
||||
end
|
||||
active_operation = operation_name
|
||||
end
|
||||
|
||||
function M.finish_contest_operation()
|
||||
active_operation = nil
|
||||
end
|
||||
|
||||
function M.get_active_operation()
|
||||
return active_operation
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue