2
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
4
<refentry id="rhythmbox-rb-async-queue-watch">
6
<refentrytitle role="top_of_page" id="rhythmbox-rb-async-queue-watch.top_of_page">rb-async-queue-watch</refentrytitle>
7
<manvolnum>3</manvolnum>
8
<refmiscinfo>RHYTHMBOX Library</refmiscinfo>
12
<refname>rb-async-queue-watch</refname>
13
<refpurpose>GSource for watching a GAsyncQueue in the main loop</refpurpose>
16
<refsynopsisdiv id="rhythmbox-rb-async-queue-watch.synopsis" role="synopsis">
17
<title role="synopsis.title">Synopsis</title>
20
<link linkend="void">void</link> (<link linkend="RBAsyncQueueWatchFunc">*RBAsyncQueueWatchFunc</link>) (<link linkend="gpointer">gpointer</link> item,
21
<link linkend="gpointer">gpointer</link> data);
22
<link linkend="guint">guint</link> <link linkend="rb-async-queue-watch-new">rb_async_queue_watch_new</link> (<link linkend="GAsyncQueue">GAsyncQueue</link> *queue,
23
<link linkend="gint">gint</link> priority,
24
<link linkend="RBAsyncQueueWatchFunc">RBAsyncQueueWatchFunc</link> callback,
25
<link linkend="gpointer">gpointer</link> user_data,
26
<link linkend="GDestroyNotify">GDestroyNotify</link> notify,
27
<link linkend="GMainContext">GMainContext</link> *context);
39
<refsect1 id="rhythmbox-rb-async-queue-watch.description" role="desc">
40
<title role="desc.title">Description</title>
42
This provides a way to feed work items to the main loop using a <link linkend="GAsyncQueue"><type>GAsyncQueue</type></link>
43
without polling it.</para>
48
<refsect1 id="rhythmbox-rb-async-queue-watch.details" role="details">
49
<title role="details.title">Details</title>
50
<refsect2 id="RBAsyncQueueWatchFunc" role="function">
51
<title>RBAsyncQueueWatchFunc ()</title>
52
<indexterm zone="RBAsyncQueueWatchFunc"><primary sortas="RBAsyncQueueWatchFunc">RBAsyncQueueWatchFunc</primary></indexterm><programlisting><link linkend="void">void</link> (*RBAsyncQueueWatchFunc) (<link linkend="gpointer">gpointer</link> item,
53
<link linkend="gpointer">gpointer</link> data);</programlisting>
55
Callback to call when an item is found in the queue.</para>
57
</para><variablelist role="params">
58
<varlistentry><term><parameter>item</parameter> :</term>
59
<listitem><simpara> the item found in the queue
60
</simpara></listitem></varlistentry>
61
<varlistentry><term><parameter>data</parameter> :</term>
62
<listitem><simpara> user data specified when creating the watch
63
</simpara></listitem></varlistentry>
64
</variablelist></refsect2>
65
<refsect2 id="rb-async-queue-watch-new" role="function">
66
<title>rb_async_queue_watch_new ()</title>
67
<indexterm zone="rb-async-queue-watch-new"><primary sortas="rb_async_queue_watch_new">rb_async_queue_watch_new</primary></indexterm><programlisting><link linkend="guint">guint</link> rb_async_queue_watch_new (<link linkend="GAsyncQueue">GAsyncQueue</link> *queue,
68
<link linkend="gint">gint</link> priority,
69
<link linkend="RBAsyncQueueWatchFunc">RBAsyncQueueWatchFunc</link> callback,
70
<link linkend="gpointer">gpointer</link> user_data,
71
<link linkend="GDestroyNotify">GDestroyNotify</link> notify,
72
<link linkend="GMainContext">GMainContext</link> *context);</programlisting>
74
Creates a new <link linkend="GSource"><type>GSource</type></link> that triggers when the <link linkend="GAsyncQueue"><type>GAsyncQueue</type></link> is
75
non-empty. This is used in rhythmbox to process queues within
76
<link linkend="RhythmDB"><type>RhythmDB</type></link> in the main thread without polling.</para>
78
</para><variablelist role="params">
79
<varlistentry><term><parameter>queue</parameter> :</term>
80
<listitem><simpara> the <link linkend="GAsyncQueue"><type>GAsyncQueue</type></link> to watch
81
</simpara></listitem></varlistentry>
82
<varlistentry><term><parameter>priority</parameter> :</term>
83
<listitem><simpara> priority value for the <link linkend="GSource"><type>GSource</type></link>
84
</simpara></listitem></varlistentry>
85
<varlistentry><term><parameter>callback</parameter> :</term>
86
<listitem><simpara> callback to invoke when the queue is non-empty
87
</simpara></listitem></varlistentry>
88
<varlistentry><term><parameter>user_data</parameter> :</term>
89
<listitem><simpara> user data to pass to the callback
90
</simpara></listitem></varlistentry>
91
<varlistentry><term><parameter>notify</parameter> :</term>
92
<listitem><simpara> function to call to clean up the user data for the callback
93
</simpara></listitem></varlistentry>
94
<varlistentry><term><parameter>context</parameter> :</term>
95
<listitem><simpara> the <link linkend="GMainContext"><type>GMainContext</type></link> to attach the source to
96
</simpara></listitem></varlistentry>
97
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the ID of the new <link linkend="GSource"><type>GSource</type></link>
98
</simpara></listitem></varlistentry>
99
</variablelist></refsect2>