1
0
Fork 0

Make global ArangoClusterComm object in each thread.

This commit is contained in:
Max Neunhoeffer 2014-01-07 11:50:05 +01:00
parent bbf28e3501
commit 11e018e6b2
2 changed files with 7 additions and 6 deletions

View File

@ -1339,15 +1339,15 @@ void TRI_InitV8Cluster (v8::Handle<v8::Context> context) {
TRI_AddMethodVocbase(rt, "drop", JS_Drop);
#endif
v8g->ServerStateTempl = v8::Persistent<v8::ObjectTemplate>::New(isolate, rt);
TRI_AddGlobalFunctionVocbase(context, "ArangoClusterComm",
v8g->ClusterCommTempl = v8::Persistent<v8::ObjectTemplate>::New(isolate, rt);
TRI_AddGlobalFunctionVocbase(context, "ArangoClusterCommCtor",
ft->GetFunction());
// register the global object
//v8::Handle<v8::Object> ss = v8g->ClusterCommTempl->NewInstance();
//if (! ss.IsEmpty()) {
// TRI_AddGlobalVariableVocbase(context, "ArangoServerState", ss);
// }
ss = v8g->ClusterCommTempl->NewInstance();
if (! ss.IsEmpty()) {
TRI_AddGlobalVariableVocbase(context, "ArangoServerState", ss);
}
}
// Local Variables:

View File

@ -43,6 +43,7 @@ TRI_v8_global_s::TRI_v8_global_s (v8::Isolate* isolate)
AgencyTempl(),
ClusterInfoTempl(),
ServerStateTempl(),
ClusterCommTempl(),
#endif
ErrorTempl(),
GeneralCursorTempl(),