AltME: R3 Protocols
Messages
Wednesday 5th June, 2013
GrahamC
21:08
is the link, this tcp-port/spec/port-state: 'ready should be 'closed or something but that's not the issue
21:10
connect [
; send-redis-request event/port
write event/port event/port/locals
]
Doing two consecutive writes?
Rebolek
21:10
No, the first one is commented.
GrahamC
21:10
oh ...
Rebolek
21:11
It's bit messy...
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?
Last message posted 490 weeks ago.