@leansdk/leanrc
Version:
LeanRC is a MVC framework for creating graceful applications
88 lines (60 loc) • 2.81 kB
text/coffeescript
# This file is part of LeanRC.
#
# LeanRC is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# LeanRC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with LeanRC. If not, see <https://www.gnu.org/licenses/>.
module.exports = (Module)->
{
AnyT
FuncG, ListG, StructG, MaybeG, UnionG
QueueInterface
ProxyInterface
} = Module::
class ResqueInterface extends ProxyInterface
()
Module
tmpJobs: ListG StructG {
queueName: String
scriptName: String
data: AnyT
delay: MaybeG Number
id: String
}
fullQueueName: FuncG String, String
create: FuncG [String, MaybeG Number], QueueInterface
all: FuncG [], ListG QueueInterface
get: FuncG String, MaybeG QueueInterface
remove: FuncG String
update: FuncG [String, Number], QueueInterface
delay: FuncG [String, String, AnyT, MaybeG Number], UnionG String, Number
getDelayed: FuncG [], ListG StructG {
queueName: String
scriptName: String
data: AnyT
delay: MaybeG Number
id: String
}
#=============== Must be realized in mixin =========
ensureQueue: FuncG [String, MaybeG Number], StructG name: String, concurrency: Number
getQueue: FuncG String, MaybeG StructG name: String, concurrency: Number
removeQueue: FuncG String
allQueues: FuncG [], ListG StructG name: String, concurrency: Number
pushJob: FuncG [String, String, AnyT, MaybeG Number], UnionG String, Number
getJob: FuncG [String, UnionG String, Number], MaybeG Object
deleteJob: FuncG [String, UnionG String, Number], Boolean
abortJob: FuncG [String, UnionG String, Number]
allJobs: FuncG [String, MaybeG String], ListG Object
pendingJobs: FuncG [String, MaybeG String], ListG Object
progressJobs: FuncG [String, MaybeG String], ListG Object
completedJobs: FuncG [String, MaybeG String], ListG Object
failedJobs: FuncG [String, MaybeG String], ListG Object
()