Simplify RunLoop

Instead of transforming between return value and callback, pass
the wrapped callback on to the invoked function as the last argument.

This eliminates the need for multiple invokeWithArgument overloads
and permits invoked functions to be asynchronous.
This commit is contained in:
John Firebaugh
2015-06-11 19:03:19 -04:00
parent 3ab682e627
commit fc64e97bce
8 changed files with 149 additions and 216 deletions

View File

@@ -19,7 +19,7 @@ public:
Impl(uv_loop_t*, const std::string &path = ":memory:");
~Impl();
std::unique_ptr<Response> get(const Resource&);
void get(const Resource&, Callback);
void put(const Resource& resource, std::shared_ptr<const Response> response);
void refresh(const Resource& resource, int64_t expires);