AltME: R3 Protocols
Messages
Wednesday 5th June, 2013
Rebolek
20:52
Bt with async (almost) working I guess I can move from it for some time and fix the styles :)
GrahamC
20:52
Anyway, I thought I explained this in my tutorial .. I need to look again to see what I wrote
20:52
in case it's not clear enough
Rebolek
20:52
Is there some new version? I remember there was only SYNC-WRITE.
GrahamC
20:53
https://github.com/gchiu/Rebol3/blob/master/protocols/prot-demo.r#L56
should be 'closed and not 'ready
20:53
No new tutorial yet .. there was an attempt to expand it .. but that has stagnated
20:54
always a problem with committee approach lol
Rebolek
20:59
Hm, the simple example works, but trying to put it in scheme does nothing yet...
GrahamC
21:02
is your redis:// on github yet?
Rebolek
21:02
Yes, but not the async part yet.
GrahamC
21:03
want to give us the gist ?
Rebolek
21:03
https://github.com/rebolek/prot-redis
21:07
I use this for testing the async version:
do %prot-redis.r3
async-handler: func [event /local port] [
port: event/port
print ["==TCP-event:" event/type]
;print ["Awake-event:" event/type]
switch/default event/type [
lookup [open event/port]
connect [
; send-redis-request event/port
write event/port event/port/locals
]
wrote [read event/port]
read [
print ["Read" length? event/port/data "bytes"]
return true
]
close [
event/port/spec/port-state: 'closed
return true
]
] [
print ["Unexpected event:" event/type]
close event/port
return true
]
false ; returned
]
rs:
redis://192.168.211.10
rp: make port! rs
rp/awake: :async-handler
open rp
write rp [SET asynctest true]
probe wait [rp 3]
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
Last message posted 489 weeks ago.