Skip to content

Priority

Request priority hints for queue management

Extension URN: urn:mesh:ext:priority


The priority extension allows clients to hint request urgency. Servers can use these hints for queue management, resource allocation, and request scheduling.


Priority hints SHOULD be used for:

  • Background vs interactive requests
  • Batch processing vs real-time operations
  • System tasks vs user-facing requests
  • Degraded mode operation (prioritize critical requests)

FieldTypeRequiredDescription
levelstringYesPriority level
reasonstringNoWhy this priority was chosen
LevelDescription
criticalSystem-critical, highest priority
highUser-facing, time-sensitive
normalStandard priority (default)
lowBackground tasks, can be delayed
bulkBatch operations, lowest priority

FieldTypeDescription
honoredbooleanWhether priority was applied
effective_levelstringActual priority used
queue_positionnumberPosition in queue (if queued)
wait_timeobjectTime spent waiting in queue

When the priority extension is included:

  1. Server SHOULD consider priority for scheduling
  2. Server MAY downgrade priority based on quotas
  3. Server MUST return whether priority was honored
  4. Higher priority does NOT guarantee faster completion

Priority operates independently of rate limits:

  • Rate limits apply equally regardless of priority
  • Priority affects order within allowed requests
  • Servers MAY have separate rate limits per priority level

{
"protocol": { "name": "mesh", "version": "0.1.0" },
"id": "req_urgent",
"call": {
"function": "payments.process",
"version": "1",
"arguments": {
"payment_id": "pay_123",
"amount": 99.99
}
},
"extensions": [
{
"urn": "urn:mesh:ext:priority",
"options": {
"level": "high",
"reason": "user_checkout"
}
}
]
}
{
"protocol": { "name": "mesh", "version": "0.1.0" },
"id": "req_urgent",
"result": {
"payment_id": "pay_123",
"status": "completed"
},
"extensions": [
{
"urn": "urn:mesh:ext:priority",
"data": {
"honored": true,
"effective_level": "high",
"wait_time": { "value": 5, "unit": "millisecond" }
}
}
]
}
{
"protocol": { "name": "mesh", "version": "0.1.0" },
"id": "req_background",
"call": {
"function": "analytics.aggregate",
"version": "1",
"arguments": {
"date_range": { "start": "2024-01-01", "end": "2024-01-31" }
}
},
"extensions": [
{
"urn": "urn:mesh:ext:priority",
"options": {
"level": "bulk",
"reason": "scheduled_report"
}
}
]
}

Server may downgrade priority based on client quotas:

{
"protocol": { "name": "mesh", "version": "0.1.0" },
"id": "req_downgraded",
"result": { "processed": true },
"extensions": [
{
"urn": "urn:mesh:ext:priority",
"data": {
"honored": false,
"effective_level": "normal",
"wait_time": { "value": 250, "unit": "millisecond" }
}
}
]
}

When server is under load:

{
"protocol": { "name": "mesh", "version": "0.1.0" },
"id": "req_queued",
"result": { "report_id": "rpt_456" },
"extensions": [
{
"urn": "urn:mesh:ext:priority",
"data": {
"honored": true,
"effective_level": "low",
"queue_position": 47,
"wait_time": { "value": 3, "unit": "second" }
}
}
]
}

Servers MAY implement priority queues:

┌──────────────────────────────────────────┐
│ Incoming Requests │
└────────────────────┬─────────────────────┘
┌────────────────┼────────────────┐
▼ ▼ ▼
┌────────┐ ┌──────────┐ ┌───────────┐
│Critical│ │ High/ │ │Low/Bulk │
│ Queue │ │ Normal │ │ Queue │
└───┬────┘ └────┬─────┘ └─────┬─────┘
│ │ │
└──────────────┴────────────────┘
┌────────────┐
│ Workers │
└────────────┘

Servers SHOULD set priority quotas per client:

Client TierCriticalHighNormalLow/Bulk
Free0%10%70%20%
Pro5%30%50%15%
Enterprise10%40%40%10%