developing-funboost-broker

Implements custom message queue brokers for the funboost Python framework.

892|166|Updated Dec 25, 2021
One-click install
npx skills add https://github.com/ydf0509/funboost --skill developing-funboost-broker-ydf0509
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-funboost-broker
Source: https://github.com/ydf0509/funboost/tree/main/.agents/skills/developing-funboost-broker
Command: npx skills add https://github.com/ydf0509/funboost --skill developing-funboost-broker-ydf0509

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires funboost.

What problem does it solve? Adding a new message queue backend to funboost requires implementing abstract Publisher and Consumer classes and registering them correctly, which is error-prone without guidance on the framework's extension contracts. ## Core Features & Use Cases - Three Extension Paths: Covers static extension for framework authors, register_custom_broker for user-space brokers, and consumer_override_cls/publisher_override_cls mixins for customizing existing brokers. - Implementation Contracts: Documents the required abstract methods (_publish_impl, clear, get_message_count, close, _dispatch_task, _confirm_consume, _requeue), the kw dictionary structure, and super() call rules. - Use Case: You need funboost to consume tasks from an in-house message queue. Implement a custom Publisher and Consumer subclass, register them with register_custom_broker, and use the new broker_kind in BoosterParams. ## Quick Start Ask the AI to implement a custom funboost broker for your message queue by subclassing AbstractPublisher and AbstractConsumer and registering it with register_custom_broker.

Frequently Asked Questions about developing-funboost-broker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a custom message queue broker to funboost?▼

Subclass AbstractPublisher and AbstractConsumer, implement the abstract methods like _publish_impl and _dispatch_task, then call register_custom_broker with a broker name. Use that name as broker_kind in BoosterParams when decorating functions with @boost.

What methods must a custom funboost Publisher implement?▼

A custom Publisher must implement four abstract methods: _publish_impl for the core publish logic, clear to purge the queue, get_message_count to return queue depth, and close to release connections. The custom_init hook is optional.

Can I customize an existing funboost broker without modifying source code?▼

Yes, use consumer_override_cls or publisher_override_cls in BoosterParams to mix in a custom class that overrides methods like _submit_task. The mixin should call super() so the original broker behavior is preserved.

Why does my custom funboost consumer not process messages?▼

The _dispatch_task loop must call self._submit_task with a kw dictionary containing a body key for every message. Also verify the broker is registered in the factory mapping if using static extension, and that _dispatch_task blocks rather than returning immediately.

When should I use register_custom_broker versus static extension in funboost?▼

Use register_custom_broker when adding a new broker from user code without modifying the framework. Use static extension only when contributing a core broker to funboost itself, which requires updating BrokerEnum, connection configs, and the factory mapping.