Skip to content

ChannelBinding

faststream.specification.asyncapi.v2_6_0.schema.bindings.redis.channel.ChannelBinding #

Bases: BaseModel

A class to represent channel binding.

ATTRIBUTE DESCRIPTION
channel

the channel name

method

the method used for binding (ssubscribe, psubscribe, subscribe)

bindingVersion

the version of the binding

channel instance-attribute #

channel

method class-attribute instance-attribute #

method = None

groupName class-attribute instance-attribute #

groupName = None

consumerName class-attribute instance-attribute #

consumerName = None

bindingVersion class-attribute instance-attribute #

bindingVersion = 'custom'

from_sub classmethod #

from_sub(binding)
Source code in faststream/specification/asyncapi/v2_6_0/schema/bindings/redis/channel.py
@classmethod
def from_sub(cls, binding: redis.ChannelBinding | None) -> Self | None:
    if binding is None:
        return None

    return cls(
        channel=binding.channel,
        method=binding.method,
        groupName=binding.group_name,
        consumerName=binding.consumer_name,
    )

from_pub classmethod #

from_pub(binding)
Source code in faststream/specification/asyncapi/v2_6_0/schema/bindings/redis/channel.py
@classmethod
def from_pub(cls, binding: redis.ChannelBinding | None) -> Self | None:
    if binding is None:
        return None

    return cls(
        channel=binding.channel,
        method=binding.method,
        groupName=binding.group_name,
        consumerName=binding.consumer_name,
    )