*** irclogger_ has joined #circuits | 03:35 | |
*** Osso has joined #circuits | 04:19 | |
*** Osso has quit IRC | 05:54 | |
*** Osso has joined #circuits | 06:17 | |
*** qwebirc173 has joined #circuits | 10:12 | |
*** Osso_ has joined #circuits | 10:43 | |
*** Osso has quit IRC | 10:54 | |
*** qwebirc89556 has joined #circuits | 14:27 | |
*** qwebirc25899 has joined #circuits | 14:48 | |
*** qwebirc94476 has joined #circuits | 14:53 | |
qwebirc94476 | hmm? | 14:54 |
---|---|---|
qwebirc94476 | my name didn't get untaken when I lost my connection. How strange. | 14:54 |
*** qwebirc3049 has joined #circuits | 14:57 | |
*** qwebirc58686 has joined #circuits | 15:00 | |
qwebirc58686 | darn. | 15:00 |
qwebirc58686 | Had hoped it would autologin for me now. | 15:00 |
*** marky1991 has joined #circuits | 15:08 | |
*** marky1991 has quit IRC | 15:14 | |
*** marky1991 has joined #circuits | 15:14 | |
*** marky1991 has quit IRC | 15:19 | |
*** marky1991 has joined #circuits | 15:20 | |
*** marky1991 has quit IRC | 15:20 | |
*** marky1991 has joined #circuits | 15:20 | |
*** marky1991 has joined #circuits | 15:23 | |
qwebirc58686 | marky1991: Test | 15:24 |
qwebirc58686 | marky1991: Test 2. | 15:25 |
*** qwebirc91241 has joined #circuits | 15:28 | |
qwebirc91241 | marky1991: hELLO. | 15:28 |
qwebirc91241 | grr | 15:28 |
*** qwebirc58686 has quit IRC | 15:29 | |
*** marky1991_2 has joined #circuits | 15:30 | |
*** marky1991 has quit IRC | 15:31 | |
prologic | what's going on? | 15:36 |
prologic | :) | 15:36 |
marky1991 | oh, hey | 15:40 |
marky1991 | I was figuring out an IRC lcient | 15:40 |
marky1991 | To replace the old __tick__ method, I made a new poller that did the code that I needed to be done in its _generate_events method. Is this the right way to do it? | 15:42 |
prologic | well yes it is | 15:43 |
prologic | but what poller did you have to write? | 15:43 |
marky1991 | okay | 15:43 |
prologic | I'm confused as to why you had to do anything at all :) | 15:43 |
marky1991 | On windows, to do async IO, you make a read/write request, and then periodically check to see if it's done yet | 15:44 |
marky1991 | I have to keep calling the check_if_its_done yet method | 15:45 |
prologic | this is for the Windows File component? | 15:46 |
marky1991 | yeah | 15:46 |
prologic | ahh | 15:46 |
prologic | sorry I was confused | 15:46 |
prologic | all the irc examples work fine afaik :) | 15:46 |
marky1991 | oh no, I was figuring out the irc program I use to access this channel | 15:46 |
prologic | I've marked the Windows Unit Tests story as being worked on by you btw | 15:46 |
marky1991 | as far as i remember, the irc rtests pass : ) | 15:47 |
prologic | are you interested in joining our pivotal tracker project? | 15:47 |
marky1991 | sure | 15:47 |
marky1991 | I think it'd be fun | 15:47 |
prologic | cool | 15:47 |
prologic | hopefully you'll keep us in check with Windows compatibility :) | 15:48 |
marky1991 | if nothing else, i want to make it work so I can get back to the original project i started on | 15:48 |
prologic | throw me your email addy (/query pro logic) | 15:48 |
prologic | and I'll add you to the project | 15:48 |
prologic | yeah I can understand | 15:48 |
prologic | and I want to help you :) | 15:48 |
prologic | I just (unfortunately) am not a Windows dev | 15:48 |
marky1991 | did that work? | 15:48 |
prologic | and probably never will be | 15:48 |
marky1991 | Seriously new to irc, if you can't tell | 15:48 |
prologic | yup :) | 15:49 |
prologic | agh IRC is great :) | 15:49 |
prologic | been around since about 1993 or so | 15:49 |
prologic | still alive and kick'n :) | 15:49 |
marky1991 | I'm not <i>really</i> a windows dev (I have no experience with the windows API), but I'm willing to read the windows docs until I figure it out | 15:50 |
prologic | done | 15:51 |
prologic | follow the email sturctions, etc | 15:51 |
prologic | and when you login | 15:51 |
prologic | take that Windows Unit Tests story | 15:51 |
marky1991 | so , back to my question: How should I register the poller with the file object? | 15:51 |
marky1991 | i saw the on_registered command for the original file object | 15:51 |
prologic | ahh | 15:52 |
prologic | hmm | 15:52 |
marky1991 | i don't understand what's going on in the else cluase though | 15:52 |
prologic | well I honestly think you should create a WindowsFile component | 15:52 |
prologic | maybe subclassing File ? | 15:52 |
marky1991 | that's what i'm trying to do | 15:52 |
prologic | or refactor it out to a base component | 15:52 |
prologic | and override the original (UNIX) File to not use the standard pollers | 15:52 |
prologic | and instead use yours | 15:52 |
prologic | refactoring the base functionality would be good | 15:53 |
marky1991 | I was going to just refdifine file if the platform was windows to my windowsFile | 15:53 |
prologic | BaseFile | 15:53 |
prologic | File | 15:53 |
prologic | WindowsFile | 15:53 |
prologic | and just make File an alias to WindowsFile | 15:53 |
marky1991 | ues | 15:53 |
prologic | or something nice | 15:53 |
marky1991 | that sounds exactly right to me | 15:53 |
marky1991 | but how do i modify the on_registered method to refer to my WindowsPoller? | 15:54 |
prologic | sorry what don't you understand? | 15:54 |
prologic | ahh | 15:54 |
prologic | yes | 15:54 |
marky1991 | i just don't understand what the code is doing after the first else clause | 15:54 |
prologic | no you want to copletely override the registered handler there | 15:55 |
prologic | that looks for a poller | 15:55 |
prologic | but you don't want that on Windows | 15:55 |
marky1991 | so, just set self._poller to WindowsPoller()? | 15:55 |
prologic | I assume you have to periodically call windows apis to poll the file? | 15:55 |
prologic | and can't use select? | 15:55 |
marky1991 | yes, that's exactly what I need tpo do | 15:55 |
marky1991 | that was the problem that made me do this in the first place | 15:55 |
prologic | mainly because you can't set a file descriptor into async mode on windows afaik | 15:55 |
marky1991 | windows doesn't support using select with files | 15:56 |
marky1991 | Yes you can | 15:56 |
marky1991 | you have to open it usign the windows API though | 15:56 |
marky1991 | that's handled already | 15:56 |
prologic | hmm | 15:56 |
prologic | no | 15:56 |
prologic | self._poller means nothing | 15:56 |
prologic | it's just a reference - not sure what I use it for | 15:56 |
prologic | the point is you don't want to register any of the select/poll/epoll/kqueue pollers at all | 15:56 |
prologic | you want to completely have your own polling component | 15:56 |
prologic | does this make sense? | 15:57 |
prologic | so you're WindowsFile component | 15:57 |
prologic | should have it's own generate_events handler | 15:57 |
marky1991 | right | 15:57 |
marky1991 | oh, | 15:57 |
prologic | where you do the polling of the file | 15:57 |
marky1991 | it shoudl | 15:57 |
marky1991 | that makes it much simpler | 15:57 |
prologic | of course :) | 15:57 |
marky1991 | i cna just throw out the special poller completely then | 15:57 |
prologic | we try to make things simple | 15:57 |
marky1991 | okay, great | 15:57 |
prologic | GenerateEvents is fired periodically throughout the system | 15:57 |
marky1991 | so generate_events is roughly the same as tick | 15:57 |
prologic | to ask any components if they wish to produce events | 15:58 |
marky1991 | rtight, that's what i saw in the code | 15:58 |
marky1991 | okay, great | 15:58 |
prologic | generate_events is exactly the same as the old ticks | 15:58 |
prologic | just better | 15:58 |
marky1991 | i might have some tests passing tonight then | 15:58 |
prologic | and we unified the whole concept into one thing | 15:58 |
prologic | event handlers | 15:58 |
marky1991 | what did it do percviously? | 15:58 |
prologic | sweet :) | 15:58 |
prologic | yes don't call your thing a poller at all | 15:59 |
prologic | just do it in a generate_events handler | 15:59 |
prologic | reason being is I don't really see it as a general purpose poller | 15:59 |
prologic | it's rather specific to windows async file i/O only | 15:59 |
prologic | right? | 15:59 |
marky1991 | exactl right | 15:59 |
prologic | select obviously is still the poller to use on windows for sockets | 15:59 |
marky1991 | the design was actually pretty ugly | 15:59 |
marky1991 | there was all sorts of shared things | 15:59 |
prologic | yeah | 15:59 |
prologic | try to share nothing | 15:59 |
prologic | that's the circuits/components way | 16:00 |
marky1991 | understood | 16:00 |
prologic | things should be done via message passing | 16:00 |
marky1991 | okoie doke | 16:00 |
prologic | aka events | 16:00 |
marky1991 | be back soonish | 16:00 |
prologic | kk | 16:00 |
marky1991 | oh wait | 16:01 |
marky1991 | one last question | 16:01 |
marky1991 | int he generate events method, what is the event parameter? | 16:01 |
marky1991 | what event is that? | 16:01 |
*** qwebirc91241 has quit IRC | 16:03 | |
prologic | generate_events handler | 16:31 |
prologic | handler :) | 16:31 |
prologic | umm | 16:31 |
prologic | that is actually a part of the circuits core | 16:31 |
prologic | every handler is capable of receiving the event object that was responsible | 16:31 |
prologic | it is quite literally the GenerateEvents event in this case | 16:32 |
prologic | eg: | 16:32 |
prologic | @handler("read") | 16:32 |
prologic | def _on_read(self, event, *args, **kwargs): | 16:32 |
prologic | ... | 16:32 |
prologic | event would also be a Read event object | 16:32 |
marky1991 | oh, that was obvious. Stupid question | 16:47 |
marky1991 | PS: First writing test passed | 16:47 |
marky1991 | woo | 16:48 |
prologic | nice work :) | 16:50 |
prologic | you're trying to keep the same API right? | 16:50 |
prologic | and keeping the tests more or less the same? | 16:50 |
*** marky1991 has joined #circuits | 17:06 | |
*** marky1991 has quit IRC | 17:45 | |
*** marky1991 has joined #circuits | 17:45 | |
*** marky1991 has quit IRC | 18:19 | |
*** marky1991 has joined #circuits | 18:20 | |
marky1991 | yes. | 19:37 |
*** marky1991 has quit IRC | 19:37 | |
prologic | yes? | 19:46 |
Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!