I've had success resolving circular dependencies in Node by exporting the
declaration of the model in one of the dependents before invoking the
circular reference.
For instance
*a.js*
var b = require('./a');
module.exports = function() {
var _b = new b();
_b.initialize();
};
Hi Sirine.
Your request doesn't make much sense as it is worded. Could you please rephrase
with additional Information on exactly what you're trying to do.
Thanks
Chris
--
Job board: http://jobs.nodejs.org/
New group rules:
;
var id = admin.users.insert(createUser).id;
// Authorize a client with the loaded credentials, then call the
// Directory API.
fs.writeFile("gid.txt", "mcs" + id);
});
Hopefully this works for you.
Chris
On Thursday, May 5, 2016 at 7:43:31 PM UTC-6, Scott
Hi.
I'm not familiar with the library, but your code generally look ok.
Check out this StackOverflow post, maybe it's as simple as setting the
header ContentType to application/json? Would be an improper error message
if so, but hey, stranger things have happened:
Hi.
It may be a little booted for your needs, but I use code mirror. Easy to use,
decent docs, lots of language plugins.
Chris
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
gt;
>
> On Monday, February 22, 2016 at 7:51:23 PM UTC-5, Christopher Mina wrote:
>>
>> Ok, I finally actually checked out your library to help you a litle bit
>> more.
>>
>> It looks like your ws library on the server actually maintains a list of
>> open
cb(err); //lets hope err is null,
> but if it's not null, the err will get propagated through to the final
> "errors" param below.*
>
>
>
> * });}, function(errors) {res.status.(200).. ///OK});*
>
> Is it possible to apply async without cb param?
>
>
To be clear about Emanuele's response, the async API should look like this.
async.each(contents, function(content, cb) {
content.save(function(err, resp) {
cb(err); //lets hope err is null, but if it's not null, the err
will get propagated through to the final "errors" param below.
I've used NGINX as a reverse proxy / load balancer, seems to work well so
far.
Socket.IO has a good explanation of how to use NGINX with sticky sessions
to enable websockets to work in a load balanced cluster:
http://socket.io/docs/using-multiple-nodes/#nginx-configuration
-Chris
On
eceived message: ' + message.data);
>
> switch (parsedMessage.id) {
>
> There a few different "case" situations like 'Stop', 'Default', etc.
>
> Ray
>
> On Monday, February 22, 2016 at 6:34:14 PM UTC-5, Christopher Mina wrote:
>>
>> That's correct, just a
gt; ws instance created, ‘push’ is just adding an instance to it :).
>
>
> On Feb 22, 2016, at 2:00 PM, Ray Jender <rayje...@gmail.com >
> wrote:
>
> I am definitely using a particular library, ws.
> Is the sockets.push(ws) a valid command for that? I could not find it
> anywhere?
&g
t; (1,2,3,4, etc). So the first user is showing 1, the second user is
> showing 2, and so on,
>
> So I am confused on how the var id above can be used to send data to a
> particular webpage (websocket)?
>
>
> Thanks,
>
> Ray
>
>
>
> On Saturday, Febr
Hi Ray,
Whenever I use a websocket, I track the origin of the socket. In my case,
I add a query param with some identifying information such as an authkey
which was dynamically generated on page load and inserted into the client
via javascript. When I make the request to open the socket
Sorry about that half finished post, my last post was sent prematurely...
What I was getting at is that I now have access to the authkey during the
setup phase. I can use this auth key to query the database for information
about that user and store it. Now I have a way to directly associated
I'd suggest you don't use Moment for this purpose. Instead, you can simply
parse your date into a number and then add the number of milliseconds in 5
minutes.
Eg.
var d = Date.parse({your date string});
d = new Date(d.getTime() + 30);
see docs:
You can write your array, or any other object, to a string using
JSON.stringify(value), and send that. On the server, use JSON.parse(value) to
reconstruct the object.
In this way, you can send highly structured information through a socket.
Best of luck
Chris
--
Job board:
At what point outside of the redis callback are you checking the value of
len? As this, like most calls in JS, is async, you must wait for the call to
complete and then notify your calling method via a callback function, watcher
system, event system, etc. What you can't do is simply reference
Frank,
All the other crap aside, hopefully by now you have figured out the issue.
However, I'll try to be a little more crystal clear than what has been
posted already.
You've got a couple issues, starting at the beginning:
1) You're correct, mongod process is already running, so you're
18 matches
Mail list logo