worker

start async task from onhandleintent

跟風遠走 提交于 2019-12-17 20:50:05
问题 Should we start async task from within onHandleIntent() method of IntentService ? I read that onHandleIntent() runs in worker thread so will it be safe to start asyncTask from there?? 回答1: IntentService s already are background-processes; there's no need to start an AsyncTask from there. Also, starting an AsyncTask is 'safe' from anywhere; it's a helper class that helps you multithread. Just make sure you don't manipulate View s in the doInBackground() -method of your AsyncTask if you use it

Sending binary data using multipart/form-data from a worker with IE11

百般思念 提交于 2019-12-13 16:46:48
问题 I'm trying to send a multipart/form-data from a worker with IE. I've already done it with Chrome, Firefox, Safari using formData objects (not supported IE, I need a manual one) The binary data I'm sending is a crypto-js encrypted data. With formData objects I do: var enc = new Buffer(encrypted.ciphertext.toString(CryptoJS.enc.Base64), 'base64'); formData.append("userFile" , new Blob([finalEncrypted], {type: 'application/octet-binary'}), 'encrypted') this works fine generating a multipart like

How to generate multi workers and bind them to non-web Java applications on Heroku

走远了吗. 提交于 2019-12-13 06:01:43
问题 I tried this tutorial to generate two workers on Heroku Server. But based on this example I just have one worker run at the same time. Is it possible to generate 2 workers that run 2 difference jobs when the application starts? I already tried to scale the workers by using: heroku ps:scale worker=2 . But when I do this it only affects to WorkerProcess class and I have two WorkerProcess classes running at the same time. 回答1: Yes, you can have as many worker processes as you'd like. They just

Improving Rails.cache.write by setting key-value pairs asynchronously

假装没事ソ 提交于 2019-12-12 21:08:20
问题 I am currently thinking about improving the performance of Rails.cache.write when using dalli to write items to the memcachier cloud. The stack, as it relates to caching, is currently: heroku, memcachier heroku addon, dalli 2.6.4, rails 3.0.19 I am using newrelic for performance monitoring. I am currently fetching "active students" for a given logged in user, represented by a BusinessUser instance, when its active_students method is called from a controller handling a request that requires a

How do Heroku workers work ?

江枫思渺然 提交于 2019-12-12 14:46:05
问题 Heroku supports multiple types of dyno configurations and allows us to set both a web and a worker process type for an app, for example like so: web: vendor/bin/heroku-php-apache2 web/ worker: php worker/myworker.php The web dyno will handle the web traffic, meanwhile the worker dyno type can be used as a background job (e.g.: to process a queue.) The docs didn't make it clear to me how these workers function, i.e.: how do they start? behave? In particular: Are they run just once at

Grails non time based queuing

白昼怎懂夜的黑 提交于 2019-12-12 14:35:25
问题 I need to process files which get uploaded and it can take as little as 1 second or as much as 10 minutes. Currently my solution is to make a quartz job with a timer of 30 seconds and then process and arbitrary job whenever it hits. There are several problems with this. One: if the job will take less than a few seconds it is wasteful to make things wait 30 seconds for the job queue. Two: if there is only one long job in the queue it could feasibly try to do it twice. What I want is a timeless

How to push job in specific queue and limit number workers with sidekiq?

筅森魡賤 提交于 2019-12-12 10:45:57
问题 I know we can do: sidekiq_options queue: "Foo" But in this case it's the Worker which is assigned to only one queue: "Foo". I need to assign a Job (and not a Worker) in specific queue. With Resque it's easy: Resque.enqueue_to(queue_name, my_job) Further, for concurrency problem, i need to limit the number of Worker on each queue at 1. How can I do this? 回答1: You might use https://github.com/brainopia/sidekiq-limit_fetch and then: Sidekiq::Client.push({ 'class' => GuidePdfWorker, 'queue' =>

Worker - having trouble to choose the best technology [closed]

心不动则不痛 提交于 2019-12-12 09:27:42
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 months ago . I want to create a micro-service for parallel processing some tasks which I get via push by an Azure Service Bus. This micro-service will notify the Azure Service Bus if the task where complete with success or not. See the following diagram: I already have this three options

Rails Resque change worker limit?

前提是你 提交于 2019-12-12 05:27:10
问题 I have Rails app with some Resque workers. It seems that I have a limit of 2 workers running simultaneously (app runs on EC2 with Apache in production). Is there any way I can raise that limit? EDIT: I have maxclients 0 in redis.conf I can start 10 workers through rake, but when they are actually getting queued, I get "ERR max number of clients reached" in browser.. EDIT: updated mistake (it was correct in original file) EDIT: actually had config/initializers/Resque.rb pointing to redis-to-go

AS3 using Workers

ぐ巨炮叔叔 提交于 2019-12-12 05:25:43
问题 IDE: FLASH CS6 Professional SDK: AIR 18 for Android I'm trying to use Workers for my app. The problem is, it doesn't work that it suppose to be. public class Main extends Sprite { private var worker:Worker; public function Main() { var ba:ByteArray = this.loaderInfo.bytes; if(Worker.current.isPrimordial){ worker = WorkerDomain.current.createWorker(ba); worker.start(); trace("Created Main"); }else{ trace("Created Worker"); } } } It should output Created Main Created Worker but i'm only getting