AltME: R3 Protocols
Messages
Wednesday 5th June, 2013
GrahamC
21:12
yeah ..
you have
port: event/port
but then still do write event/port
Rebolek
21:12
yes, but it shouldn't be problem, no? It's copypasted from two different versions...
GrahamC
21:13
It looks good to me .. but I only just woke up
Rebolek
21:14
It prints "Read 5 bytes" and then waits until timeout. [Return true] is there so I guess it should work. But it doesn't :/
GrahamC
21:15
why are you not using the port returned by 'open?
Rebolek
21:15
you mean like [rp: open rp] ?
21:16
I copied that code from the example on rebol.net
GrahamC
21:17
well, here
https://github.com/rebolek/prot-redis/blob/master/prot-redis.r3#L402
you return the newly opened port .. so I thought you'd use it ?
Andreas
21:20
Bolek, you don't install an awake handler on the TCP subport.
21:21
In line 400, you explicitly clear the awake handler on the TCP subport:
https://github.com/rebolek/prot-redis/blob/master/prot-redis.r3#L400
21:21
So I don't think the awake handler you install on the Redis parent port (the example you pasted above) will be called at all.
GrahamC
21:22
so, you need to get the port returned by open and install the async handler on that
Andreas
21:22
Right.
GrahamC
21:23
I was getting there ... heh
Rebolek
21:24
But READ in ASYNC-HANDLER gets called.
Andreas
21:25
Are you absolutely sure about that?
Rebolek
21:25
I changed the line 400 to [tcp-port/awake: :redis-port/awake] and it's still the same.
21:26
Andreas: PRINT prints in console, so I guess it should.
Andreas
21:28
And it prints even without setting the subport's awake?
GrahamC
21:29
rp: open
redis://192.168.2.11:10
rp/awake: :async-handler
write rp [ SET asynctest true ]
wait [ rp 3 ]
21:30
does that do anything?
Last message posted 490 weeks ago.