10 feat download queue (#59)
* testing message queue * better mq syncronisation * major code refactoring, concern separation. * bugfix * code refactoring * queuesize configurable via flags * code refactoring * comments * code refactoring, updated readme
This commit is contained in:
@@ -99,4 +99,19 @@ export const datetimeCompareFunc = (a: string, b: string) => new Date(a).getTime
|
||||
|
||||
export function isRPCResponse(object: any): object is RPCResponse<any> {
|
||||
return 'result' in object && 'id' in object
|
||||
}
|
||||
|
||||
export function mapProcessStatus(status: number) {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return 'Pending'
|
||||
case 1:
|
||||
return 'Downloading'
|
||||
case 2:
|
||||
return 'Completed'
|
||||
case 3:
|
||||
return 'Error'
|
||||
default:
|
||||
return 'Pending'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user