using-funboost-basics

Create distributed Python task functions with the funboost @boost decorator and message queues.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires funboost.

What problem does it solve? Turning a plain Python function into a distributed, queue-backed task normally requires learning complex worker frameworks. This Skill guides the AI to write correct funboost code using the @boost decorator and BoosterParams, avoiding common mistakes like passing raw arguments to @boost or misusing push/publish. ## Core Features & Use Cases - Task Definition: Create distributed task functions with @boost(BoosterParams(...)) supporting 40+ message queue brokers, concurrency modes, QPS limits, and retries. - Message Publishing: Publish tasks with push, publish with TaskOptions (countdown, custom task_id), or async aio_push/aio_publish. - Consumer Management: Start single or multiple consumers, use multi-process consumption, and access task context via fct. - Use Case: You need to crawl 100 URLs concurrently with rate limiting and automatic retries. The Skill produces a @boost-decorated function with concurrent_num, qps, and max_retry_times configured, plus push and consume calls. ## Quick Start Write a funboost distributed task using @boost with BoosterParams that consumes URLs from a Redis queue with 30 concurrent workers and a QPS limit of 10.

Frequently Asked Questions about using-funboost-basics

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

FAQPage Schema
How do I create a distributed task with funboost in Python?▼

Decorate a plain function with @boost(BoosterParams(queue_name="my_queue", broker_kind=BrokerEnum.REDIS_ACK_ABLE)). Call func.push(arg) to publish messages and func.consume() to start the consumer. Always pass a BoosterParams object, never raw arguments to @boost.

What is the difference between push and publish in funboost?▼

push accepts only business parameters as function arguments, like func.push(x, y). publish takes a dictionary of business parameters plus task_options=TaskOptions(...) for framework controls such as countdown delays and custom task_id values.

How do I limit QPS and concurrency for a funboost consumer?▼

Set concurrent_num and qps fields in BoosterParams, for example BoosterParams(queue_name="q", concurrent_num=30, qps=10). You can also choose concurrent_mode such as threading, gevent, eventlet, or async.

Can funboost consume messages published by Java or Go systems?▼

Yes. Set should_check_publish_func_params=False in BoosterParams and define the consumer function with **kwargs to receive arbitrary JSON structures. Do not use a single parameter to receive the whole message dictionary.

How do I access task context like task_id in a funboost function?▼

Import fct from funboost and access attributes such as fct.task_id, fct.queue_name, fct.function_params, and fct.full_msg inside the task function. Do not use Celery-style self or bind=True patterns.

Why does pushing a funboost instance method fail?▼

Instance methods must be pushed via the class: ClassName.method.push(obj_instance, arg1), passing the instance as the first argument. Writing obj.method.push(arg1) is incorrect and will not bind the instance properly.