World: r3wp
[!REBOL3 Schemes] Implementors guide
older newer | first last |
Graham 29-Jun-2010 [2096x5] | Oh yeah ... don't wipe the Db ... but I've made a backup anyway. It's the demo employee.fdb that comes with firebird. You can do this db: open jdbcbridge://www.compkarori.co.nz:8020 insert db {select first 3 * from employee} result: copy db |
Ok, updated the protocol to remove the waits inside the handler ... and it is working now. I can now detect the close event from the server. | |
Still don't know if I can reuse the port after the server closes it .. or, whether i need to create a new subport | |
going to think on the syntax to get the database metadata ... as I should be able to get column names, and types | |
Anyone tried this out? | |
Graham 3-Jul-2010 [2101] | What's the best way to determine whether the server has completed sending data if the server does not close the port? |
Steeve 3-Jul-2010 [2102] | like for any protocol, the server must send the length of the data at first |
Graham 3-Jul-2010 [2103x4] | pop uses .crlf ftp closes the data port |
http uses a content-length ... | |
I guess I should try that ... sending a length | |
pop uses crlf.crlf .. sorry | |
Pavel 12-Aug-2010 [2107] | Any simple protocol example available, something like the R2 one long time on rebolforces, but for R3? I'd like to implement protocol above 'file schema. Any help/hint welcome. |
Graham 12-Aug-2010 [2108] | Yes, check my github site |
Pavel 12-Aug-2010 [2109x3] | I've looked at your shemes already, but all of the are network related. Some easy pedagogical example would help me :) how to ommit port numbers (maybe they are not neccesary) and especially how to manage subport in 'file. Anyway impressive bunch of schemes. |
typo all of them | |
may the sheme be asynchrnous alhough file scheme is synchronous (I presume)? | |
Henrik 12-Aug-2010 [2112] | Robert made an overview of how ports work a while ago. I'm not sure if it's available publicly. |
Graham 12-Aug-2010 [2113] | file io is sync isn't it? |
Pavel 12-Aug-2010 [2114x2] | Thats what I wrote |
But ok sub port cannot be unleashed from above schema right? | |
Graham 12-Aug-2010 [2116x2] | why not? |
the main port is just an abstraction .. to allow you to work on the real port | |
Pavel 12-Aug-2010 [2118] | Thats what I ask, may the scheme be asynchronous when low level port is synronous and we dont use tasks yet? |
Graham 12-Aug-2010 [2119] | I don't think so |
Maxim 12-Aug-2010 [2120x2] | I guess we'll need device extensions for briging the gap. |
briging = bridging | |
Pavel 12-Aug-2010 [2122] | Has anybody tried some file related scheme? zip// or somethink like was in disscussion? |
Graham 12-Aug-2010 [2123] | I'm missing what is the point? the network schemes are written to try and emulate file io ... |
Maxim 12-Aug-2010 [2124] | access to RIF? |
Pavel 12-Aug-2010 [2125] | Graham I like to write a scheme for my mini RIF implementation yes maxim |
Maxim 12-Aug-2010 [2126] | direct DB table access using read/write would be VERY powerfull :-) |
Pavel 12-Aug-2010 [2127] | Ie write number to port get record back, write record to port get number back for the very beginning |
Andreas 12-Aug-2010 [2128x2] | make-scheme [ name: 'foo title: "FOO Protocol" spec: make system/standard/port-spec-head [] actor: [ open: func [port [port!]] [ print 'open make-scheme [ name: 'foo title: "FOO Protocol" spec: make system/standard/port-spec-head [] actor: [ open: func [port [port!]] [ print 'open ] read: func [port [port!]] [ print 'read ] ] ] f: open foo://bar.baz read f |
hmm, ignore the first duplicate part of the paste | |
Pavel 12-Aug-2010 [2130] | good andreas muchas gracias you know I'm a beginner |
Graham 12-Aug-2010 [2131] | There's a typo there .. FOO should be RIF :) |
Pavel 12-Aug-2010 [2132x2] | should a file to be implemented into read for real reading? (how to) |
into read actor | |
Andreas 12-Aug-2010 [2134x2] | yes. you can just use normal READ to read from a file within the read actor |
if you want to keep a file open, you can keep port-local state in port/state | |
Pavel 12-Aug-2010 [2136x2] | OK thanks I'll try my own, anyway is there any distinction if fileport is open/closed? after close the information is still open |
ie port looks the same open or closed and open? returns true, more the port cannot be deleted/removed currious | |
Graham 12-Aug-2010 [2138] | What's the current state of RIF? |
Andreas 12-Aug-2010 [2139x2] | CLOSE on a foo port will be a no-op, unless you implement a close actor. |
Same for OPEN?. | |
Pavel 12-Aug-2010 [2141x2] | graham I've commented it in DB chat , to be honest I thin Carl would do it better but I cannot wait more |
andreas missunderstanding when f: open %file close f open? f returns true | |
Graham 12-Aug-2010 [2143] | we can't wait for Carl to do everything .. just have to be prepared to discard our work if he rewrites it! |
Pavel 12-Aug-2010 [2144] | exact |
Graham 12-Aug-2010 [2145] | you'd write your own 'open? actor |
older newer | first last |