Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
poll file descriptor in node.js
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Henri Tuhola  
View profile  
 More options Nov 3 2012, 5:40 pm
From: Henri Tuhola <henri.tuh...@gmail.com>
Date: Sat, 3 Nov 2012 14:40:20 -0700 (PDT)
Local: Sat, Nov 3 2012 5:40 pm
Subject: poll file descriptor in node.js

I want to do an event emitter that gets events from libudev.

udev_monitor_get_fd gives me a file descriptor that I'd need to poll, and
once the descriptor wakes up I'd need to call udev_monitor_receive_device
to retrieve the event so I can emit it.

Am I able to do this with node.js and libuv or do I need to pack that
monitor into it's own thread?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bert Belder  
View profile  
 More options Nov 3 2012, 6:14 pm
From: Bert Belder <bertbel...@gmail.com>
Date: Sat, 3 Nov 2012 15:14:01 -0700 (PDT)
Local: Sat, Nov 3 2012 6:14 pm
Subject: Re: poll file descriptor in node.js

On Saturday, November 3, 2012 10:40:20 PM UTC+1, Henri Tuhola wrote:

> I want to do an event emitter that gets events from libudev.

> udev_monitor_get_fd gives me a file descriptor that I'd need to poll, and
> once the descriptor wakes up I'd need to call udev_monitor_receive_device
> to retrieve the event so I can emit it.

> Am I able to do this with node.js and libuv or do I need to pack that
> monitor into it's own thread?

If you're targeting node 0.8.0 or later, you can use uv_poll:
https://github.com/joyent/node/blob/44dd2c392a1378c081b5b21cf5d987e75...

- Bert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Henri Tuhola  
View profile  
 More options Nov 5 2012, 3:57 pm
From: Henri Tuhola <henri.tuh...@gmail.com>
Date: Mon, 5 Nov 2012 12:57:12 -0800 (PST)
Local: Mon, Nov 5 2012 3:57 pm
Subject: Re: poll file descriptor in node.js

Thanks from your help.

Here's something back: https://github.com/cheery/node-udev

sunnuntai, 4. marraskuuta 2012 0.14.01 UTC+2 Bert Belder kirjoitti:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »