@@ -35,11 +35,43 @@ class GitOdb : public ObjectWrap {
3535 static Handle<Value> Open (const Arguments& args);
3636 static Handle<Value> AddDiskAlternate (const Arguments& args);
3737 static Handle<Value> Read (const Arguments& args);
38+ static void ReadWork (uv_work_t * req);
39+ static void ReadAfterWork (uv_work_t * req);
40+
41+ struct ReadBaton {
42+ uv_work_t request;
43+ int error_code;
44+ const git_error* error;
45+ git_odb_object * out;
46+ Persistent<Value> dbReference;
47+ git_odb * db;
48+ Persistent<Value> idReference;
49+ const git_oid * id;
50+ Persistent<Function> callback;
51+ };
3852 static Handle<Value> ReadPrefix (const Arguments& args);
3953 static Handle<Value> ReadHeader (const Arguments& args);
4054 static Handle<Value> Exists (const Arguments& args);
4155 static Handle<Value> Refresh (const Arguments& args);
4256 static Handle<Value> Write (const Arguments& args);
57+ static void WriteWork (uv_work_t * req);
58+ static void WriteAfterWork (uv_work_t * req);
59+
60+ struct WriteBaton {
61+ uv_work_t request;
62+ int error_code;
63+ const git_error* error;
64+ git_oid * out;
65+ Persistent<Value> odbReference;
66+ git_odb * odb;
67+ Persistent<Value> dataReference;
68+ const void * data;
69+ Persistent<Value> lenReference;
70+ size_t len;
71+ Persistent<Value> typeReference;
72+ git_otype type;
73+ Persistent<Function> callback;
74+ };
4375 static Handle<Value> Hash (const Arguments& args);
4476 static Handle<Value> Hashfile (const Arguments& args);
4577 git_odb *raw;
0 commit comments