Skip to content

feat: priority queue for transaction processing#1

Open
Dafuriousis wants to merge 1 commit intodevelopfrom
feat/priority-queue
Open

feat: priority queue for transaction processing#1
Dafuriousis wants to merge 1 commit intodevelopfrom
feat/priority-queue

Conversation

@Dafuriousis
Copy link
Copy Markdown
Owner

Adds priority column to transactions table and updates processor ordering.

Changes:

  • Migration: ADD COLUMN priority SMALLINT NOT NULL DEFAULT 0
  • Index: idx_transactions_priority on (status, priority DESC, created_at ASC)
  • Transaction model: priority field, new_with_priority() constructor
  • process_batch: ORDER BY priority DESC, created_at ASC
  • CallbackPayload: optional priority field (0=normal,1=high,2=critical)
  • Integration tests for ordering and default value

- Migration: ADD COLUMN priority SMALLINT NOT NULL DEFAULT 0
- Index: idx_transactions_priority on (status, priority DESC, created_at ASC)
- Transaction model: priority field with serde default 0
- Transaction::new_with_priority constructor; ::new defaults to 0
- insert_transaction: bind priority column
- processor: ORDER BY priority DESC, created_at ASC
- callback handler: accept optional priority field, clamped to [0,2]
- Integration tests: ordering and default value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant