FeedsPool

FeedsPool — feeds auto-fetcher

Stability Level

, unless otherwise indicated

Synopsis

                    FeedsPool;
FeedsPool*          feeds_pool_new                      ();
void                feeds_pool_listen                   (FeedsPool *pool,
                                                         GList *feeds);
GList*              feeds_pool_get_listened             (FeedsPool *pool);
void                feeds_pool_switch                   (FeedsPool *pool,
                                                         gboolean run);
SoupSession*        feeds_pool_get_session              (FeedsPool *pool);

Object Hierarchy

  GObject
   +----FeedsPool

Signals

  "feed-fetching"                                  : Run Last
  "feed-ready"                                     : Run Last

Description

The FeedsPool permits to automatically "listen" for more feeds: it provides to fetch them on regular intervals (as defined by feed_channel_get_update_interval() for each channel), parse them with FeedParser, and emits signals when feeds are ready

Details

FeedsPool

typedef struct _FeedsPool FeedsPool;


feeds_pool_new ()

FeedsPool*          feeds_pool_new                      ();

Allocates a new FeedsPool

Returns :

a new FeedsPool

feeds_pool_listen ()

void                feeds_pool_listen                   (FeedsPool *pool,
                                                         GList *feeds);

To set the list of feeds to be managed by the pool. The previous list, if any, is invalidated. After invokation to the function, feeds_pool_switch() must be call to run the auto-fetching (always, also if previous state was "running"). The list in feeds can be freed after calling this; linked FeedChannel are g_object_ref'd here

pool :

a FeedsPool

feeds :

a list of FeedChannel

feeds_pool_get_listened ()

GList*              feeds_pool_get_listened             (FeedsPool *pool);

Returns number of feeds under the pool control, as provided by feeds_pool_listen(). To get the complete list of those feeds, check feeds_pool_get_listened()

pool :

a FeedsPool

Returns :

number of feeds currently managed by the FeedsPool

feeds_pool_switch ()

void                feeds_pool_switch                   (FeedsPool *pool,
                                                         gboolean run);

Permits to pause or resume the pool fetching feeds. If run is TRUE, the pool starts immediately

pool :

a FeedsPool

run :

TRUE to run the pool, FALSE to pause it

feeds_pool_get_session ()

SoupSession*        feeds_pool_get_session              (FeedsPool *pool);

To access the internal SoupSession used by the pool to fetch items

pool :

a FeedsPool

Returns :

istance of SoupSession. Do not free it

Signal Details

The "feed-fetching" signal

void                user_function                      (FeedsPool *pool,
                                                        GObject   *feed,
                                                        gpointer   user_data)      : Run Last

Emitted when the pool starts fetching a new FeedChannel. To be used to know the internal status of the component

pool :

the FeedsPool emitting the signal

feed :

the FeedChannel which is going to be fetched

user_data :

user data set when the signal handler was connected.

The "feed-ready" signal

void                user_function                      (FeedsPool *pool,
                                                        GObject   *feed,
                                                        gpointer   items,
                                                        gpointer   user_data)      : Run Last

Emitted when a FeedChannel assigned to the pool has been fetched and parsed. If items may be NULL, if an error occourred while fetching and/or parsing. List of items is freed, and his elements are unref'd, when signal ends

pool :

the FeedsPool emitting the signal

feed :

the FeedChannel which has been fetched and parsed

items :

list of FeedItem obtained parsing the feed

user_data :

user data set when the signal handler was connected.