Grss.FeedsSubscriber

g GObject.Object GObject.Object Grss.FeedsSubscriber Grss.FeedsSubscriber GObject.Object->Grss.FeedsSubscriber

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_address ()

get_listened ()

get_port ()

get_session ()

listen (feeds)

set_port (port)

switch (run)

Virtual Methods

Inherited:

GObject.Object (7)

do_notification_received (feed, item)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

notification-received

Emitted when a notification has been received and parsed.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Grss.FeedsSubscriber(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Grss.FeedsSubscriberClass

classmethod new()
Returns:

a new Grss.FeedsSubscriber.

Return type:

Grss.FeedsSubscriber

Allocates a new Grss.FeedsSubscriber.

get_address()
Returns:

the Gio.InetAddress used by self, or None if the Grss.FeedsSubscriber is switched off.

Return type:

Gio.InetAddress

This function returns the Internet address where self is listening for external events. It is often required by #GrssFeedsSubscriberHandlers while subscribing contents to specify the local endpoint for communications.

get_listened()
Returns:

a list of Grss.FeedChannel, to be freed with g_list_free() when no longer in use. Do not modify elements found in this list.

Return type:

[Grss.FeedChannel]

Returns the list of feeds currently managed by self.

get_port()
Returns:

the port of the socket locally opened by self.

Return type:

int

This function returns the Internet port where self is listening for external events. It is often required by #GrssFeedsSubscriberHandlers while subscribing contents to specify the local endpoint for communications.

get_session()
Returns:

the Soup.Session used by the provided Grss.FeedsSubscriber.

Return type:

Soup.Session

To obtain the internal Soup.Session of a Grss.FeedsSubscriber, so to re-use it in #GrssFeedsSubscriberHandlers or similar tasks.

listen(feeds)
Parameters:

feeds ([Grss.FeedChannel]) – a list of Grss.FeedChannel.

Returns:

True if all Grss.FeedChannels involved in feeds are valid and can be listened with one of the implemented procotols, False otherwise.

Return type:

bool

To set the list of feeds to be managed by self. The previous list, if any, is invalidated. After invokation to the function, Grss.FeedsSubscriber.switch() must be call to run the subscription. The list in feeds can be freed after calling this; linked Grss.FeedChannel are GObject.Object.ref'd here.

set_port(port)
Parameters:

port (int) – new listening port for the server.

To customize the port opened by the local server to catch incoming publishers’ events. By default this is 8444. Changing the port while the subscriber is running imply restart the local server. Pay attention to the fact many publishers’ implementations accept only certain ports.

switch(run)
Parameters:

run (bool) – True to run the subscriber, False to pause it.

Permits to pause or resume self listening for events.

do_notification_received(feed, item) virtual
Parameters:

Signal Details

Grss.FeedsSubscriber.signals.notification_received(feeds_subscriber, feed, item)
Signal Name:

notification-received

Flags:

RUN_LAST

Parameters:

Emitted when a notification has been received and parsed. The item is cached and unref’d when the Grss.FeedsSubscriber is destroyed or a new set of feeds is provided.