[tracker/direct-access: 17/40] libtracker-sparql: Add async API



commit ec8bee0e3623a16b6f17db50d31ff0189b9e2d12
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jul 13 14:42:27 2010 +0200

    libtracker-sparql: Add async API

 src/libtracker-direct/tracker-connection.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-direct/tracker-connection.vala b/src/libtracker-direct/tracker-connection.vala
index f3bbbb9..9c9bf90 100644
--- a/src/libtracker-direct/tracker-connection.vala
+++ b/src/libtracker-direct/tracker-connection.vala
@@ -33,12 +33,17 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection {
 		initialized = false;
 	}
 
-	public override Sparql.Cursor query (string sparql) throws GLib.Error {
+	public override Sparql.Cursor query (string sparql, Cancellable? cancellable) throws GLib.Error {
 		var query_object = new Sparql.Query (sparql);
 		var cursor = query_object.execute_cursor ();
 		cursor.connection = this;
 		return cursor;
 	}
+
+	public async override Sparql.Cursor query_async (string sparql, Cancellable? cancellable = null) throws GLib.Error {
+		// just creating the cursor won't block
+		return query (sparql, cancellable);
+	}
 }
 
 public Tracker.Sparql.Connection module_init (Tracker.Sparql.PluginLoader loader) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]