AltME: R3 Protocols

Messages

Rebolek
Andreas: PRINT prints in console, so I guess it should.
Andreas
And it prints even without setting the subport's awake?
GrahamC
rp: open redis://192.168.2.11:10
rp/awake: :async-handler
write rp [ SET asynctest true ]
wait [ rp 3 ]
does that do anything?
Andreas
(Warning: IP address mangled.)
Rebolek
Graham, this prints "Read 5 bytes" and the wait for 3 seconds.
the=then
GrahamC
In your write actor you rewrite the event handler I think
Rebolek
I guess this should put the async-handler into tcp-port, no?
GrahamC
anyway getting too complicated for me ...
Rebolek
This ASYNC write is old code that doesn't work, it uses some non-existent functions
GrahamC
I mean if you already set up a hander, why are you rewriting it ?
Rebolek
I set up the handler for the redis-port and here it's moved to the tcp-port
It's probably copied from some example.
From the HTTP protocol.
GrahamC
maybe
redis-port/state/awake: :port/awake
should be
redis-port/state/awake: :redis-port/awake
because in our write actor, there is no 'port defined
our => your
just guessing now ... must have breakfast!
Rebolek
I changed the Async part of WRITE to:
            ;  --- ASYNCHRONOUS OPERATION
                unless open? redis-port [cause-error 'Access 'not-open redis-port/spec/ref]
                tcp-port: redis-port/state/tcp-port
                either probe tcp-port/spec/port-state = 'ready [
                    write tcp-port to binary! make-bulk-request data
                ][
                    tcp-port/locals: to binary! make-bulk-request data
                ]

Last message posted 489 weeks ago.