osvenskan / posix_ipc

Other
135 stars 24 forks source link

Methods `fileno()` for compatiability with `selectors` #7

Closed henrikh closed 6 years ago

henrikh commented 6 years ago

The selectors module can register objects which export a fileno() method which returns the file descriptor integer.

This is already exported by, for example, mqd and fd, but maybe a method for fileno() could also be added?

A current workaround is to extend the classes from posix_ipc and add the method.

osvenskan commented 6 years ago

@henrikh Thanks for the suggestion. Just to be clear, you'd like to see the SharedMemory and MessageQueue classes add fileno() methods so they can be used with selectors, is that correct? If I add that in a branch, are you willing to help me test it? Tack på förhand. 🙂

henrikh commented 6 years ago

Yes, you got it right.

I can help. I might have time to test it in the beginning of next week. Så lidt 🙂

osvenskan commented 6 years ago

I pushed code to the develop branch that adds the fileno() method. Please try it out and let me know if it behaves well for you. If it does, I'll release a new version. And if you have any sample code to share, I'd appreciate it. I haven't used the selectors module.

osvenskan commented 6 years ago

Hej @henrikh, have you had a chance to check out the develop branch?

henrikh commented 6 years ago

Hi @osvenskan , sorry for not getting back to you -- I has been quite busy with finishing up a project at work. If it is pressing for you, then I can see if I can get it done this week.

osvenskan commented 6 years ago

@henrikh Ingen fara/No worries, take your time.

osvenskan commented 6 years ago

Resolved by #14. Will be in the version after 1.0.5.