从Google云端存储中提取RAR文件(Extract RAR files from Google Cloud Storage)
我使用RAR实用程序(100GB未压缩,20GB压缩)获得了一个大的多部分压缩CSV文件,因此我有100个RAR文件部分,这些部分已上传到Google云端存储。 我需要将其提取到Google云端存储。 如果我可以在GAE上使用Python,那将是最好的。 有任何想法吗? 我不想下载,提取和上传。 我想在云端做所有事情。
I got a big multipart compressed CSV file using RAR utility (100GB uncompressed, 20GB compressed), so I have 100 RAR file parts, that were uploaded to Google Cloud Storage. I need to extract it to Google Cloud Storage. It would be best if I could use Python on GAE. Any ideas? I don't want to download, extract, and upload. I want to do it all in the cloud.
原文:https://stackoverflow.com/questions/12985181
最满意答案
以这种方式使用延迟是没有意义的。 延期代表一个行动; 你不能将它用作事件发射器。 您在启动异步操作时使用延迟,并希望在该操作成功或失败时执行某些操作。
$.post()
返回一个promise(实际上它返回一个jqXHR实例,但它实现了promise接口),因此你可以执行$.post(...).fail(handleFailure).done(handleSuccess)
。 但是每次发生某事时你都不能使用延迟来运行一些代码。It makes no sense to use a deferred in that manner. A deferred represents an action; you cannot use it as an event emitter. You use a deferred when you start an asynchronous action, and want to do something when that action succeeds or fails.
$.post()
returns a promise (actually it returns a jqXHR instance, which however implements the promise interface), so you can do$.post(...).fail(handleFailure).done(handleSuccess)
. But you cannot use a deferred to run some code every time something happens.
相关问答
更多-
jQuery如何延迟使用?(How can jQuery deferred be used?)[2023-06-19]
我可以想到的最好的用例是缓存AJAX响应。 这是Rebecca Murphey的介绍文章的一个修改例子: var cache = {}; function getData( val ){ // return either the cached value or jqXHR object wrapped Promise return $.when( cache[ val ] || $.ajax('/foo/', { data: { ... -
jQuery.Deferred是jQuery实现promise模式的主要工具。 以下是一些链接,值得一读: [SO]实现承诺模式 [jQuery文档]延期 [wikipedia]期货和承诺 至于你的具体需求:你应该使用.then() (阅读.done()和.then() )的文档。 var deferred = $.Deferred(); deferred.then(function(value) { alert(value); return 42; }).then(function(id ...
-
resolveWith()回退和失败回退分别由Deferred调用resolveWith()和rejectWith()的创建者调用; 这些函数采用的两个参数传递给回调。 所以它完全取决于创建Deferred对象的函数的类型。 (上下文通常但不一定是Deferred对象本身。) Done fallbacks and fail fallbacks are invoked by the creator of the Deferred calling resolveWith() and rejectWith(), ...
-
找到一个扩展jQuery延迟处理“多个延迟的setter和resolvers”的片段: $.extend({ StatelessDeferred: function () { var doneList = $.Callbacks("memory"), promise = { done: doneList.add, // Get a promise for this deferred // If obj is provided, the ...
-
关于jQuery.Deferred()(About jQuery.Deferred())[2023-09-02]
当我们调用.reject()然后调用.reject() ,我们将返回一个我们已经决定不会成功的承诺。 任何与.fail()或.always()绑定的处理程序将在添加它们时立即调用。 When we call .reject() and then .promise(), we are returning a promise that we have already decided will not succeed. Any handlers bound with .fail() or .always() wi ... -
以这种方式使用延迟是没有意义的。 延期代表一个行动; 你不能将它用作事件发射器。 您在启动异步操作时使用延迟,并希望在该操作成功或失败时执行某些操作。 $.post()返回一个promise(实际上它返回一个jqXHR实例,但它实现了promise接口),因此你可以执行$.post(...).fail(handleFailure).done(handleSuccess) 。 但是每次发生某事时你都不能使用延迟来运行一些代码。 It makes no sense to use a deferred in th ...
-
返回一个jQuery Deferred(Returning a jQuery Deferred)[2023-01-31]
正如安迪指出的那样,不要return if(noNeedForAjax) { var d = new $.Deferred(); d.resolve([]); d; }; 或者,对于“一行做” if (noNeedForAjax) {$.when(function() {return []})}; 希望这可以帮助 As Andy pointed out, try without return if(noNeedForAjax) { var d = new $.Deferr ... -
不,你不能使用.fail 。 但是,您不需要将函数作为第一个参数传递给.then : 如果不需要该类型的回调,则参数可以为null 。 因为只有then才能启用链接,你应该使用 asyncThatWillFail().then(null, function () { console.log("error"); return $.Deferred().resolve(); }).then(function () { console.log("continuing on success ...
-
使用jQuery延迟异步任务(Deferred Async Tasks with jQuery)[2022-03-21]
JSFiddle: https ://jsfiddle.net/TrueBlueAussie/v6cgak1u/2/ 这使用promise = promise.then(functionReturningNextPromise)模式: function syncAll() { var promise = $.when(); // Start with a resolved promise. var forms = [ {'name':'form 1'}, {'nam ... -
首先,确保getSubscriptionTypes实际返回Promise。 没有必要在其中创建自己的$.Deferred - 这样做是一个承诺反模式 : function getSubscriptionTypes(st_id) { return $.ajax({ type: "POST", url: "addUser.php", data: { st_id: st_id }, dataType: "jso ...