Implement send default and R/W to file
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const smpp = require("smpp");
|
||||
|
||||
// TODO: Implement on change event and propagate it to sessions
|
||||
export class Job {
|
||||
pdu: any;
|
||||
perSecond?: number;
|
||||
@@ -15,6 +16,14 @@ export class Job {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
|
||||
static deserialize(serialized: any): Job {
|
||||
if (!serialized.pdu.command) {
|
||||
throw new Error("Invalid serialized job");
|
||||
}
|
||||
let pdu: any = new smpp.PDU(serialized.pdu.command, serialized.pdu);
|
||||
return new Job(pdu, serialized.perSecond, serialized.count);
|
||||
}
|
||||
|
||||
static createEmptySingle(): Job {
|
||||
return new Job({});
|
||||
}
|
||||
|
Reference in New Issue
Block a user