swarmcity / sc-protocol-docs

The protocol documentation
0 stars 0 forks source link

SIP: Queue #20

Open kingflurkel opened 7 years ago

kingflurkel commented 7 years ago

Insert a transaction in a queue. Script is continuously iterating over the items in the queue, checking the status of the transaction. Fires events on status update.

bkawk commented 7 years ago

Block Tasks

Triggered on creation of a new block

Recurring Tasks

For Everyone

Health Check

One time tasks

One time tasks are not added to the queue but are processed on request.

Specific User


A Task

The Queue

Queue Manager

Task Sheduler

Event Log

Error Log


Events

On Startup

On Connect

When a user connects we add the Repeating tasks for a specific user to the queue

socketId: 8d79fg7d9f8g7
publicKey: 0x00d8fg0d9f8g0dfg90df8g09d8fgcckk
connectedTime: 23234234234

On Disconnect

When a user disconnects we remove the Repeating tasks for a specific user to the queue

socketId: 8d79fg7d9f8g7
publicKey: 0x00d8fg0d9f8g0dfg90df8g09d8fgcckk
connectedTime: 23234234234

On Block

When a block occours

ghost commented 7 years ago

If the balance of all connected users is checked for every block, the majority will result in "no change". If the node is a full node, it could provide all Transfer logs, and the API service could calculate all balances of all addresses. Then the balance for any address would be known and up to date just by listening to the Transfer log filter.