Job typeis all jobs with same name.
job typemay have its custom configuration taken from
privatix core config.
TryLimit- Maximum retry count
TryPeriod- Delay between retries
FirstStartDelay- Delay on first start
Duplicated- Allow duplicate of job type per object
Type- job type
RelatedID- database id of related object
CreatedAt- time when job was created. Organize sequence
NotBefore- delaying start of job
CreatedBy- who produced this job
TryCount- number of times was job executed
Data- additional data that can be processed during job execution
RelatedID. It may also have some data that is stored in
NotBefore. They can be retried several times when
job type configuration.
queue.Add()will check, if desired job can be created, create it or return an error.
Job queue workers- are threads, that periodically scans job queue, retrieves jobs that should be processed and executes them. Workers can run in parallel, can retrieve error codes from underlying functions. Number of workers are defined in
dappctrl.config.json. Jobs that relates to same object are processed by single worker, preventing race.
Job queuegets jobs from database table
jobs. Jobs related to single object (e.g. particular offering) processed sequentially, but jobs for different objects (e.g. two different offerings) maybe processed in parallel. Sequence is defined using sorting by
AgentAfterChannelCreate- registers client and creates
AgentAfterChannelTopUp- updates deposit of a channel in Agents database.
AgentAfterUncooperativeCloseRequest- sets channel's status to challenge period.
AgentAfterUncooperativeClose- marks channel closed uncooperatively.
AgentAfterCooperativeClose- marks channel as closed cooperatively.
AgentPreServiceSuspend- marks service as suspended.
AgentPreServiceUnsuspend- marks service as active.
AgentPreServiceTerminate- terminates the service.
AgentPreEndpointMsgCreate- prepares endpoint message to be sent to client.
AgentPreOfferingMsgBCPublish- publishes offering to blockchain.
AgentAfterOfferingMsgBCPublish- updates offering status and account balance.
AgentPreOfferingPopUp- pop ups an offering.
AgentAfterOfferingPopUp- updates the block number when the offering was popped up.
AgentPreOfferingDelete- calls PSC remove an offering.
AgentAfterOfferingDelete- set offering status to 'remove'
ClientAfterOfferingDelete- sets offer status to
ClientAfterOfferingPopUp- updates offering in DB or retrieves from Agent and stores in DB.
ClientPreChannelCreate- triggers a channel creation.
ClientAfterChannelCreate- activates channel and triggers access message retrieval
ClientEndpointCreate- decodes endpoint message, saves it in the DB and triggers product configuration.
ClientAfterUncooperativeClose- changes channel status to closed uncooperatively.
ClientAfterCooperativeClose- changes channel status to closed cooperatively and launches termination of service.
ClientPreUncooperativeClose- terminates service.
ClientPreChannelTopUp- checks client balance and creates transaction to increase channel deposit.
ClientAfterChannelTopUp- updates deposit of a channel in local DB.
ClientPreUncooperativeCloseRequest- requests uncooperative close of channel. Challenge period started.
ClientAfterUncooperativeCloseRequest- waits for channel to close uncooperatively, starts the service termination process.
ClientPreServiceTerminate- terminates service.
ClientPreServiceSuspend- suspends service.
ClientPreServiceUnsuspend- activates service.
ClientAfterOfferingMsgBCPublish- creates offering.
ClientCompleteServiceTransition- complete service state transition. Service status changes.
PreAccountAddBalanceApprove- approve balance if amount exists.
PreAccountAddBalance- adds balance to PSC.
AfterAccountAddBalance- updates PSC and PTC balance of an account.
PreAccountReturnBalance- returns from PSC to PTC.
AfterAccountReturnBalance- updates PSC and PTC balance of an account.
AccountUpdateBalances- updates PTC, PSC and ETH account balance values.
DecrementCurrentSupply- finds offering and decrements its current supply for Client.
IncrementCurrentSupply- finds offering and increments its current supply for Client.