Very bad... This trick is the only one way I found to inherit from class
exported by binary addon.
пятница, 8 июня 2012 г., 16:35:12 UTC+4 пользователь Tim Smart написал:
__proto__ is marked for depreciation in upcoming ecmascript specs. I think
that is the most common reason you might find.
I would like to propose that an additional parameter, `context` be added to
core node modules that accept callbacks to give this-ness to the callback.
The reason being is that I'm trying to eliminate anonymous callbacks from
my code and have generally cleaner, more readable code (as well as lower
Yes, That's what I am suggesting.
AJ ONeal
On Fri, Jun 8, 2012 at 12:17 PM, Tim Caswell t...@creationix.com wrote:
So this proposal is to modify the API of all async functions to have an
extra thisp argument after the callback argument (like done in
Array.prototype.forEach)?
On Fri, Jun
I think it's a useful addition, but it does cause a little overhead (though
it's probably not noticeable compared to the actual work the async function
is doing). EventEmitters might feel the pain since they are sync. I do
worry that it makes things harder for our argument guessing code that
If you're going to use `this` then you must have a callback. It would make
no sense to have a `this` and nothing to apply it to.
You think EventEmitters would feel the overhead of the if?
// context is Array, Object, or Function.
// Numbers, Strings, and Booleans need not `apply` (very
Actually event emitters already call in the scope of the emitter, so there
is no need for a specific this value there. Just subclass EventEmitter
and use normal methods.
On Fri, Jun 8, 2012 at 1:34 PM, AJ ONeal coola...@gmail.com wrote:
If you're going to use `this` then you must have a
emitter.on('data', myModule.dataHandler, myModule);
Even if myModule were to subclass EventEmitter, wouldn't I still need to
pass in the `myModule` instance so that I get the correct `this`? I don't
think I understood what you meant by that.
And then these cases as well:
what's wrong with .bind() ?
On Jun 8, 11:52 am, AJ ONeal coola...@gmail.com wrote:
emitter.on('data', myModule.dataHandler, myModule);
Even if myModule were to subclass EventEmitter, wouldn't I still need to
pass in the `myModule` instance so that I get the correct `this`? I don't
think
No need to change the API, we have .bind() - use the language
features, don't reinvent them.
2012/6/8 Tim Caswell t...@creationix.com:
On Fri, Jun 8, 2012 at 2:10 PM, tjholowaychuk tjholoway...@gmail.com
wrote:
what's wrong with .bind() ?
Mainly the overhead. Bind creates a new function
If I'm not mistaken, bind() has the same technical drawbacks as using an
anonymous function (higher memory usage, more garbage collection, and
slower says Tim), but it does solve the maintainability / prettiness issue.
I just want to point out that Raspberry Pi is now shipping.
NodeJS is a very
Technically, at least in V8, .bind is a lot lighter weight than an
anonymous function. There are a large number of micro-benchmarks to look
at on jsperf.com, but for an actual anecdote, at one point we accidentally
required in a module which overrode Function.prototype.bind with something
that
Though significantly faster than making a closure, .bind is still fairly
expensive, and creates a heap allocation, which adds to heap pressure and
time spent garbage collecting, which (in our, admittedly, not particularly
normal, case) is our biggest performance concern - with a real-time system
Interesting. So have you found bind() to be more or less efficient than
.call() and or .apply()?
AJ ONeal
On Fri, Jun 8, 2012 at 3:48 PM, Jimb Esser wastel...@gmail.com wrote:
Technically, at least in V8, .bind is a lot lighter weight than an
anonymous function. There are a large number of
This has been previously discussed on nodejs -
http://groups.google.com/group/nodejs/browse_thread/thread/220f9faac1b61798/8f3e85ec7e73f806?lnk=gstq=nikhil+marathe
On Sat, Jun 9, 2012 at 3:44 AM, AJ ONeal coola...@gmail.com wrote:
Interesting. So have you found bind() to be more or less
On Jun 8, 1:33 am, Hugues Hardel hhar...@gmail.com wrote:
My understanding is that the ulimit value is set once and for all (...and
for all users) ? I am not a Linux expert so I could totally be wrong here.
FWIW I will sometimes create a user, assign their resource limits
(including max file
I was recently searching for the same bindings, I did found
https://github.com/c4milo/fusejs but that is also not finished yet
On Friday, June 8, 2012 at 1:42 AM, Marak Squires wrote:
Is anyone working on fuse bindings for node / has working fuse bindings yet?
see:
On Jun 8, 3:33 am, Veeru veerabhadraiah...@gmail.com wrote:
Hello everyone,
I want to know if there is anything in node.js that works as XMPP presence?
I believe so, search for 'xmpp' on http://search.npmjs.org
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
Yeah, I think a few of us were working on Fuse bindings, but the projects
have all kind of died, would be good to see one or two restarted; I think the
main issue was trying to integrate the to event loops in a manner that made
sense.
– Micheil
On 08/06/2012, at 7:56 AM, Arnout Kazemier
Nodeclipse http://www.nodeclipse.org/ is an plugin that adds IDE
functionality to the Eclipse http://www.eclipse.org/ for the
Node.jshttp://www.nodejs.org/
.
The purpose of Nodeclipse is to create an environment in which development
of Node.js is easy for a beginner to intermediate user.
Hi,
Is there a way to embed node.js in a java application to use the node.js
HTTP / WebSocket server (instead of Eclipse Jetty Web Server) with
integration solutions like Apache Camel (= java framework) to route,
enrich, aggregate, split info for real time applications ?
Regards,
Charles
--
Hi,
Is it possible to deploy different versions of node.js (0.6.x, 0.7.x)
servers on a machine and to switch easily from one to another ? Is there a
script that we can use for that purpose ?
Regards,
Charles
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
Hi,
Is there an equivalent of jmx java api to monitor node.js servers and
applications running it ?
Regards,
Charles
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are
I'm trying to build a proxy server using node.js that abides by all
the RFC-2616 rules for general proxy servers, e.g. inserting Via:
headers (sec 14.45) and deleting hop-by-hop headers such as
Connection: and the headers mentioned in Connection: (sec. 14.10). You
know, the kind of proxy server
I'd like to know too.
Thanks,
Chris.
On Friday, 25 February 2011 09:32:49 UTC, rolfn wrote:
With
os.hostname()
I can ask for the name of my host. But how can I get the full
qualified hostname?
Thanks in advance,
Rolf
--
Job Board: http://jobs.nodejs.org/
Posting
This thread had a great list of possible solutions:
https://groups.google.com/group/nodejs/browse_thread/thread/5b1a7a7cb15aa41/c17704c75f452940
-- Daniel R. dani...@neophi.com [http://danielr.neophi.com/]
On Fri, Jun 8, 2012 at 3:58 AM, Charles Moulliard
cmoulli...@fusesource.com wrote:
Hi,
There is this:
https://github.com/nearinfinity/node-java
I think it lets you call out to java from node, which is a bit different
than embedding. Not sure if this helps your situation or not.
If you're interested in tight integration with Java, you might also check
out an alternative to
I believe nvm will do what you need.
https://github.com/creationix/nvm
On Fri, Jun 8, 2012 at 2:58 AM, Charles Moulliard cmoulli...@fusesource.com
wrote:
Hi,
Is it possible to deploy different versions of node.js (0.6.x, 0.7.x)
servers on a machine and to switch easily from one to another ?
var hostname = unknown host;
spawn2('hostname', ['--fqdn'], function(err, stdout, stderr) {
hostname = stdout;
});
/*
* This function augments the spawn function with:
* 1. extra logging
* 2. a timeout to kill the whole process, if a child does not return
* 3. an optional callback to be
jaja, ok, by the way I mented phpjs ;-)
Yes, isolation is and aim to achieve, but it could sort out the big
quantity of functions that nodejs is coming to get.
Really I have in my mind the way that Java does. That's right, it use
namespaces, and we do so!! modules are like namespaces.
I've been bugging TJ on node-canvas (https://github.com/LearnBoost/
node-canvas/issues/177#issuecomment-6154062) about a code speed up I'm
working on in a fork of his node module.
I found Canvas.toBuffer() to be killing our pipeline resources and
created an alternative that would simply convert
El 01/06/12 21:57, Alan Gutierrez escribió:
On Fri, Jun 01, 2012 at 12:42:42PM -0700, Martin Wawrusch wrote:
On Fri, Jun 1, 2012 at 2:26 PM, Seiji Sam Leeseijisam...@gmail.com
wrote:
Due the great expectation around node.js, libs and functions grow up
without control.
Nowadays we have a lot
El 01/06/12 21:59, Isaac Schlueter escribió:
No, we're not going to do this. The module system is finished. It
won't be changing except for critical bugs.
On Fri, Jun 1, 2012 at 12:57 PM, Alan Gutierreza...@prettyrobots.com wrote:
On Fri, Jun 01, 2012 at 12:42:42PM -0700, Martin Wawrusch
like Tim said, so if you changed:
var Client = require(./client);
to
var Client = require(./client)();
or
Object.create(Client,
to
Object.create(Client(),
it should work
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
Of course, not proof against badly configured machines.
hostname --fqdn on server setup by somebody else bjsapps17 gives me the
'long' answer, 'bjsapps17' :-/
host bjsapps17 gives me bjsapps17.example.com has address 10.39.37.251.
Maybe try multiple techniques and choose the longest
Can you give us a quick summary of features?
On Thu, Jun 7, 2012 at 9:33 PM, Lamb lamb52...@gmail.com wrote:
Nodeclipse http://www.nodeclipse.org/ is an plugin that adds IDE
functionality to the Eclipse http://www.eclipse.org/ for the
Node.jshttp://www.nodejs.org/
.
The purpose of
noo
Just kidding, nice work.
I just worked for way too long at IBM, where everything is eclipse based :)
Nuno
On Fri, Jun 8, 2012 at 5:59 PM, Mark Hahn m...@hahnca.com wrote:
Can you give us a quick summary of features?
On Thu, Jun 7, 2012 at 9:33 PM, Lamb
On Fri, Jun 8, 2012 at 6:41 PM, Thomas Shinnick tshin...@gmail.com wrote:
Of course, not proof against badly configured machines.
hostname --fqdn on server setup by somebody else bjsapps17 gives me the
'long' answer, 'bjsapps17' :-/
host bjsapps17 gives me bjsapps17.example.com has
Flow-Control
Love it. Hate it. Learn about it.
Video: http://youtu.be/aHswD_Kwk9U
Slides: http://bit.ly/Kmp5Qt
At UtahJS Conf 2012 I presented on Flow Control. Unfortunately the video
quality is lacking and you have to open the slides and flip through them on
your own. I may re-upload with the
I completely forgot to send the link to the Utah Open Source JavaScript
Track vids last month:
In particular, there is this one on writing C++ NodeJS modules:
http://www.youtube.com/watch?v=3lAn8SgTasIfeature=BFalist=PLF006D6215357F29E
The full playlist is here:
It depends on how much work the callbacks were doing on each read - my
echo server test case hits this issue at around 200mbits/s on my
machine, and we were sometimes seeing this on production servers which
were doing a lot of work (and definitely no where near that
throughput, though it was
Does anyone know how to deal with this kind of thing?
I have process A that forks 3 processes, but when an exception occurs in
process A and it's not caught, it never dies and stays like a zombie
waiting for something...
Somehow the forked processes are preventing the parent process from
It worked great. Thanks!
On Friday, June 8, 2012 11:39:25 AM UTC-4, Dave Clements wrote:
like Tim said, so if you changed:
var Client = require(./client);
to
var Client = require(./client)();
or
Object.create(Client,
to
Object.create(Client(),
it should work
--
Job Board:
A similar idea was considered by Ryan a few years ago. I think it looked like
this
import('modulename')
All the exports are dumped by name in to the scope. There was also some
copy-on-write isolate stuff in there if i remember correctly.
It was scrapped as a bad idea for a lot of the reasons
haven't read the slides or seen the video yet but i have to say: love the title
:)
On Jun 8, 2012, at June 8, 201211:15 AM, AJ ONeal wrote:
Flow-Control
Love it. Hate it. Learn about it.
Video: http://youtu.be/aHswD_Kwk9U
Slides: http://bit.ly/Kmp5Qt
At UtahJS Conf 2012 I presented on
Nuno,
I had the same reaction.
Good job, Lamb. I'm sure people without deep Eclipse scares will
appreciate this.
Daniel Shaw
@dshaw
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because
[Moved to nodejs instead of nodejs-dev since this is of general interest
and only tangental to the original request]
I've never thought of using .bind instead of .call, but since .bind does
allocate something, and .call theoretically doesn't have to, I'd just
assume .call is more efficient,
Shogun,
Wondering how you use the session plugin? I'm hoping to use sessions with
the MVC part and socket.io part.
On Tuesday, May 8, 2012 5:17:24 PM UTC-5, Shogun wrote:
Hi all!
I know there already a lot of mini and almost full future frameworks for
Node.js but anyway i build my own.
Hi guys,
I know you'd heard about this a while back when we were first
exploring it, but it's my pleasure to officially announce the
Microsoft Driver for Node.JS for SQL Server is now available as a
preview. It's Open Source, it's hosted on Github, and we accept (and
welcome!) contributions from
On Fri, Jun 8, 2012 at 9:41 PM, Rambo demia...@gmail.com wrote:
Does anyone know how to deal with this kind of thing?
I have process A that forks 3 processes, but when an exception occurs in
process A and it's not caught, it never dies and stays like a zombie waiting
for something...
Somehow
On Fri, Jun 8, 2012 at 7:23 PM, Jimb Esser wastel...@gmail.com wrote:
[Moved to nodejs instead of nodejs-dev since this is of general interest
and only tangental to the original request]
I've never thought of using .bind instead of .call, but since .bind does
allocate something, and .call
Binding more than once is very common - any code that is written with
a closure instead can be written with a static function and a .bind
(and, in general, be more efficient, causing less heap pressure).
But, yeah, the immediate bind vs call was just in response to AJs
query, and it's pretty
On Friday, June 8, 2012 at 8:29 PM, Jimb Esser wrote:
Binding more than once is very common
The bound function returned by fn.bind cannot be rebound and will silently
ignore any attempts to do so.
- any code that is written with
a closure instead can be written with a static
FWIW, my experience with .bind on V8 has always been that it's actually
significantly slower than just creating a closure yourself. For a
microbenchmark, see http://jsperf.com/bind-vs-closure
Besides the memory overhead of using bind vs calling with call, bind has
strange semantics. For
By binding more than once, I mean binding the same original function
multiple times (with different parameters), not binding the result of
a previously bound function.
An example of using bind instead of a closure:
original:
function backupFile(filename, cb) {
fs.unlink(filename + '.bak',
On Sat, Jun 9, 2012 at 4:59 AM, catshow ga...@dynafocus.com wrote:
I am working on a new Apple Push Notification server using node.js. I am
having issues with node not emitting the close event on a TLS SecureStream
after getting an EPIPE error event. Has anyone else had this happen? It
And, bringing this back to the original poster's request for callback-
taking API functions which take this arguments, I compared
simulating the two methods in the last post, as well as if the API
functions allowed for a this to be passed in [1], and heap growth
per call was roughly:
closure:
snip
[1] https://gist.github.com/2899468
Nothing about the code in this gist actually needs to use bind(), but your
findings are certainly as expected - bind() actually creates a whole new
function object to return, whereas closing over with a function expression
or passing as arguments
On Jun 9, 2012, at 00:19, Angelo Chen wrote:
In a centos server, I tried this, and get 7:
node
d1 = new Date(Fri, 08 Jun 2012 00:00:00 GMT)
Fri, 08 Jun 2012 00:00:00 GMT
d1.getDate()
7
in my local Lion OS X, I tried this, and get 8, why:
node
d1 = new Date(Fri, 08 Jun 2012 00:00:00
Luca, I've used it without too many problems, but like catshow I think
you might be hitting more of a c2dm limit than a nodejs limit... Can
you confirm throughput rates with another tool, say, python? I don't
send that many notifications but I'm interested to know what message
caps exist...
On
There certainly is a reason, it makes for (arguably) cleaner code in
some cases (quite arguably not so in this example =), and can be used
to have one *less* function on the stack than if you made a closure
(e.g. fs.unlink(fn2, fs.rename.bind(fs, fn1, fn2, cb)); ) - at least
it appears that a
n is a great little node version manager and easy to type!
On Jun 8, 3:58 am, Charles Moulliard cmoulli...@fusesource.com
wrote:
Hi,
Is it possible to deploy different versions of node.js (0.6.x, 0.7.x)
servers on a machine and to switch easily from one to another ? Is there a
script that we
correct, thanks.
On Jun 9, 1:25 pm, Ryan Schmidt google-2...@ryandesign.com wrote:
On Jun 9, 2012, at 00:19, Angelo Chen wrote:
In a centos server, I tried this, and get 7:
node
d1 = new Date(Fri, 08 Jun 2012 00:00:00 GMT)
Fri, 08 Jun 2012 00:00:00 GMT
d1.getDate()
7
in
62 matches
Mail list logo