Skip to content

Commit 60c1866

Browse files
committed
Added Async functionality
Reached Async Land adding error handling testing commit + apply callback fixed field_accessor template on windows
1 parent 172e4ad commit 60c1866

File tree

8 files changed

+924
-292
lines changed

8 files changed

+924
-292
lines changed

generate/scripts/generateJson.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ module.exports = function generateJson() {
6161
// Split each type from the array into classes/structs and enums
6262
// each entry is of type ['name', {definingobject}]
6363
libgit2.types.forEach(function(current) {
64-
console.log(current[1]);
6564
current[1].typeName = current[0];
6665

6766
// just log these out to a file for fun

generate/templates/manual/include/filter_registry.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,50 @@ class GitFilterRegistry : public
3636
static NAN_METHOD(GitFilterRegister);
3737

3838
static NAN_METHOD(GitFilterUnregister);
39+
40+
struct FilterBaton {
41+
const git_error* error;
42+
git_filter *filter;
43+
char *filter_name;
44+
int filter_priority;
45+
int error_code;
46+
};
47+
48+
struct SimpleFilterBaton {
49+
const git_error* error;
50+
char *filter_name;
51+
int error_code;
52+
};
53+
54+
class RegisterWorker : public Nan::AsyncWorker {
55+
public:
56+
RegisterWorker(
57+
FilterBaton *_baton,
58+
Nan::Callback *callback
59+
) : Nan::AsyncWorker(callback)
60+
, baton(_baton) {};
61+
~RegisterWorker() {};
62+
void Execute();
63+
void HandleOKCallback();
64+
65+
private:
66+
FilterBaton *baton;
67+
};
68+
69+
class UnRegisterWorker : public Nan::AsyncWorker {
70+
public:
71+
UnRegisterWorker(
72+
SimpleFilterBaton *_baton,
73+
Nan::Callback *callback
74+
) : Nan::AsyncWorker(callback)
75+
, baton(_baton) {};
76+
~UnRegisterWorker() {};
77+
void Execute();
78+
void HandleOKCallback();
79+
80+
private:
81+
SimpleFilterBaton *baton;
82+
};
3983
};
4084

4185
#endif

0 commit comments

Comments
 (0)