mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Allow instantaneous returns for nativeScriptJobs
This commit is contained in:
@@ -886,9 +886,10 @@ Tomahawk.NativeScriptJobManager = {
|
|||||||
deferreds: {},
|
deferreds: {},
|
||||||
invoke: function (methodName, params) {
|
invoke: function (methodName, params) {
|
||||||
var requestId = this.idCounter++;
|
var requestId = this.idCounter++;
|
||||||
Tomahawk.invokeNativeScriptJob(requestId, methodName, encodeParamsToNativeFunctions(params));
|
var deferred = RSVP.defer();
|
||||||
this.deferreds[requestId] = RSVP.defer();
|
this.deferreds[requestId] = deferred;
|
||||||
return this.deferreds[requestId].promise;
|
Tomahawk.invokeNativeScriptJob(requestId, methodName, encodeParamsToNativeFunctions(params));;
|
||||||
|
return deferred.promise;
|
||||||
},
|
},
|
||||||
reportNativeScriptJobResult: function (requestId, result) {
|
reportNativeScriptJobResult: function (requestId, result) {
|
||||||
var deferred = this.deferreds[requestId];
|
var deferred = this.deferreds[requestId];
|
||||||
|
Reference in New Issue
Block a user