Comments (3)
Since we are very often reading the queue, we might as well have one global queue variable to reduce memory usage.
At this moment, if there is a large queue, we might be needlessly hitting memory limits before the garbage collector has a chance to clear our scoped queue variables.
Or we might just null the scoped queue variables immediately after use.
from fitbit-asap.
The current version of the code base resolves the memory issue by storing only the message IDs in memory—the messages themselves are stored as individual files on disk.
As far as running out of disk space, this library is already self-limiting via the timeout
option. For applications where very high disk usage is likely, I think it makes more sense for this to be managed at the application level.
I'm closing this issue for now.
from fitbit-asap.
Hi @daveyjones, I'm using your library and I'm having similar concerns. I suppose the "timeout" option is not enough to protect against hitting the memory /storage bound. In current source code, this option works to reduce memory overhead when process() is called, but what if the PeerSockect connection is off for a rather long time? Then we would've kept enqueuing (writing to disk) non-stop till we hit the memory bound, which might trigger an exception and potentially crash the app(I'm not sure how Fitbit handles this)? As a developer, I don't want to risk crashing the app or losing newer messages instead of older ones, and nor do I have a callback for calling asap.send() to gain some control over this issue.
Maybe we should call process() more often? e.g. In function enqueue(), instead of calling process() only when queue is previously empty, we call it every time.
from fitbit-asap.
Related Issues (13)
- get_queue failing and stopping js execution HOT 3
- Reliability and ACKs HOT 8
- Provide a way to control queue persistence HOT 3
- What about I/O blocking? HOT 3
- Test coverage HOT 1
- Onerror callback on message expiration HOT 1
- Consolidate app and companion code HOT 1
- Message received only once? HOT 8
- send_next() stops scheduling resends on second error HOT 5
- On dequeue, queue is completely emptied every time HOT 3
- Callback for "message acked" HOT 2
- fitbit-asap doesn't force a connection HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fitbit-asap.