How would you do heavy processing in Meteor?

I have a meteor application that is currently pulling data from twitter and then doing some manipulations and then inserting documents into the collection. Let's say I start this process forever, but don’t want to block the event loop, is there any solution for this?

Note. I know that node.js is single-threaded, and the meteor does not support packages such as a cluster, since it requires sticky sessions. The only solution I can think of is to add a server designed to process data coming from Twitter and forward requests to this server, but then I no longer have to use Meteor or node.

Help will be appreciated.

+4
source share
2 answers

The truth here is that while javascript / node / meteor may be able to handle, you really don't want to do this yourself. Let me give you some comments and a personal example:

  • Your application is delayed. If one of your requests takes a long time because it is stuck in a tight loop, it affects every other client connected to your server at that moment. If this happens, latency will increase. (This refers to ensuring that there are no hard loops in your code).
  • Javascript () . ( double). , float, long, int, byte, , . , , . ( , ).

, . , setInterval, 2 , . ( ). , , 4 . .

clojure. , mongo db, clojure , , , , meteor.

clojure 100 ( 2-4 ).

: , ? , , , -. , , .

+1

this.unblock() , . , , , , . : http://docs.meteor.com/#method_unblock

0

Source: https://habr.com/ru/post/1523613/


All Articles