Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add --factory param #1440

Merged
merged 1 commit into from
May 11, 2024
Merged

Conversation

Sehat1137
Copy link
Contributor

@Sehat1137 Sehat1137 commented May 11, 2024

import os

from faststream import FastStream
from faststream.rabbit import RabbitBroker
from faststream.security import SASLPlaintext


def get_app() -> FastStream:
    broker = RabbitBroker(
        host=os.environ["RABBITMQ_HOST"],
        port=int(os.environ["RABBITMQ_PORT"]),
        security=SASLPlaintext(
            username=os.environ["RABBITMQ_USER"],
            password=os.environ["RABBITMQ_PASS"],
        ),
        virtualhost="/",
    )
    faststream = FastStream(broker)
    return faststream

Right now u can start this app like factory

faststream run main:get_app --factory

It`s also support for docs

faststream docs serve main:get_app --factory
faststream docs gen main:get_app --factory

and publish

faststream publish some:get_app --factory --message={}

@Lancetnik Lancetnik enabled auto-merge May 11, 2024 19:34
@Lancetnik Lancetnik added this pull request to the merge queue May 11, 2024
Merged via the queue into airtai:main with commit d100d5f May 11, 2024
31 checks passed
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.

2 participants