port/awake: func [event] [ ;print ["Awake-event:" event/type] switch/default event/type [ lookup [open event/port] connect [send-redis-request event/port] wrote [read event/port] read [ print ["Read" length? event/port/data "bytes"] read event/port ] close [return true] ] [ print ["Unexpected event:" event/type] close event/port return true ] false ; returned ] port ]
print "REDIS reading..." rp: read-redis tcp://192.168.211.10:6379 wait [rp 10] close rp print to-string rp/data
It's adapted from the HTTP example where it works fine, but with another scheme I can't get it to work.
GrahamC
Sorry, does the above work or not?
Rebolek
It sort of works. Request is send and response is read back but instead of returning immediately, it waits for timeout. The HTTP example from rebol.net wiki returns immediately.