[REBOL] Re: async interface
From: rotenca:telvia:it at: 9-Mar-2004 19:15
Hi Andreas,
> ; default dispatcher
> handle: func [ port [port!] state [word! error!] ] [
> either error? state [
> on-error port state
> ] [
> switch state [
> connect [ on-connect port ]
> close [ on-close port ]
> read [ on-read port ]
> write [ on-write port ]
> ]
> ]
> ]
> ]
> -- snap --
>
> The 'handle dispatcher is to smoothly use object!'s based on the above
> as 'awake handler.
In my last implementation i used a scheme just like your, a dispatch function
which can be used to call functions in an objects or different functions.
---
Ciao
Romano