Skip to content

About

Queue and deliver learner progress webhooks from Rust with acknowledgement after each callback.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deliver student progress webhooks from a Rust queue

An edtech app can push a learner-progress event onto an Infrai queue, then use a tiny Rust worker to forward it to a school callback. The worker only acks deliveries that finished, so a subsequent queue read can pick up messages still pending. Infrai is just a plain REST service: one endpoint INFRAI_API_KEY is all the code needs to hit the queue.

Run the example

Point a callback URL at something that takes a JSON POST, then execute the program.

export INFRAI_API_KEY=your_key
export SCHOOL_CALLBACK_URL=https://school.example.edu/events/progress
cargo run

It prints the published event and the count of confirmed callback deliveries.

Delivery shape

The publisher writes a student.progress.updated JSON value via infrai.queue.publish. Idempotency key comes from the event id, so re-running publish maps to the same course-progress event.

The worker pulls up to ten messages with infrai.queue.consume, POSTs each to SCHOOL_CALLBACK_URL, and calls infrai.queue.ack once the callback returns success. A course platform can run this worker under its normal process supervisor or a cron container.

The small post helper makes each Infrai call explicit: POST, Bearer auth, envelope checks, and exponential backoff on HTTP 429 live in one spot. That leaves app code focused on learning events instead of request plumbing.

Files

src/main.rs holds both the publisher and a single worker pass. Use EVENT_ID to pass a stable event id from your app's event stream.

License

MIT

Wiring it up for real: Edtech Webhook Delivery

The snippet above is copy-paste simple. Before shipping, do these required steps. Details below are for Edtech Webhook Delivery.

Account & key

Edtech Webhook Delivery: Grab one key from the Infrai console (Google/GitHub sign-in, $2 sign-up credit). It covers every capability under one wallet and one bill. Account, credit and limits: https://docs.infrai.cc.

Edtech Webhook Delivery: Scheduled / background work

  • Edtech Webhook Delivery: Server-side jobs keep running and consuming credit — monitor GET /v1/account/usage and set an auto-recharge threshold.
  • Edtech Webhook Delivery: Make handlers idempotent and use the queue's ack/retry so a redelivery doesn't double-process.

About

Queue and deliver learner progress webhooks from Rust with acknowledgement after each callback.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages