AltME: R3 Protocols

Messages

Rebolek
Oh, I see...
Thanks, Graham!
GrahamC
Or, restructure your loop the same way as I did
NP .. still waiting on text-table and text-list fixes :)
Rebolek
I know, I''m sorry...I'm spending too much time with Redis ;)
Bt with async (almost) working I guess I can move from it for some time and fix the styles :)
GrahamC
Anyway, I thought I explained this in my tutorial .. I need to look again to see what I wrote
in case it's not clear enough
Rebolek
Is there some new version? I remember there was only SYNC-WRITE.
GrahamC
No new tutorial yet .. there was an attempt to expand it .. but that has stagnated
always a problem with committee approach lol
Rebolek
Hm, the simple example works, but trying to put it in scheme does nothing yet...
GrahamC
is your redis:// on github yet?
Rebolek
Yes, but not the async part yet.
GrahamC
want to give us the gist ?
Rebolek
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
is the link, this tcp-port/spec/port-state: 'ready should be 'closed or something but that's not the issue
connect [
;           send-redis-request event/port
            write event/port event/port/locals
        ]
Doing two consecutive writes?
Rebolek
No, the first one is commented.

Last message posted 146 weeks ago.