Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Async API (was: Async call:// protocol v1.0)

From: rotenca:telvia:it at: 19-Feb-2004 20:29

Hi Doc, I understand your point and i agree. I think that could be followed a path like the View one. i am thinking to the feel object, with recurring standard name until is possibile: My first attempt make me think to (arguments here are only example): port/locals/feel: make object! [ resolve: func ["dns lookup done" port][] read: func ["read op done" port][] write: func ["write op done" port][] end: func ["connection is closed by peer or task is at the end" port][] connect: func [ "connection is open" port][] detect: func ["low-level" port][] ] or port/locals: make object! [ .... (internal stuff) resolve: func ["dns lookup done" port][] read: func ["read op done" port][] write: func ["write op done" port][] end: func ["connection is closed by peer or task is at the end" port][] connect: func [ "connection is open" port][] detect: func ["low-level" port][] ] or it could be a block not an object. port/locals/feel: [] Not all functions are needed for all protocols, and sometimes they can have other meanings. In both cases, it should be a good thing to permit the user to define the function at make port! time. To reach this goal, a syntax could be: 1) p: open/custom url [resolve: [user-code ] read: [user-code]] or 2) p: open/custom url reduce [resolve: func [port data][user-code ] read: func [port data][user-code]] or 3) p: open/custom url [resolve: [port data][user-code ] read: [port data][user-code]] the last permits to define local vars without reducing the block: p: open/custom url [resolve: [port data /local a b c][user-code ]] perhaps all 3 cases could be supported by the handler with a parse rule. What do you think? --- Ciao Romano