Package apiclient :: Module push :: Class Channel
[hide private]
[frames] | no frames]

Class Channel

source code


Base class for channel types.

Instance Methods [hide private]
 
__init__(self, channel_type, channel_args)
Create a new Channel.
source code
 
as_header_value(self)
Create the appropriate header for this channel.
source code
 
write_header(self, headers)
Write the appropriate subscribe header to a headers dict.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, channel_type, channel_args)
(Constructor)

source code 
Create a new Channel.

You probably won't need to create this channel manually, since there are
subclassed Channel for each specific type with a more customized set of
arguments to pass. However, you may wish to just create it manually here.

Args:
  channel_type: str, the type of channel.
  channel_args: dict, arguments to pass to the channel.

Overrides: object.__init__

as_header_value(self)

source code 
Create the appropriate header for this channel.

Returns:
  str encoded channel description suitable for use as a header.

write_header(self, headers)

source code 
Write the appropriate subscribe header to a headers dict.

Args:
  headers: dict, headers to add subscribe header to.