r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3 Schemes] Implementors guide

Graham
24-Jan-2010
[1800x2]
so, it's system/contexts/user/user ... we can store a user object 
here?
And set-net will store the data here too?
BrianH
24-Jan-2010
[1802x3]
system/contexts/user is the script context. You can put whatever 
script-accessible words you want there.
We are using modules and access functions like set-net instead of 
global options objects, for the most part.
The system structure of R3 is very different from R2.
Graham
24-Jan-2010
[1805]
I think we can work with everything being in system/contexts/user/user 
for the purposes of a scheme for the moment
BrianH
24-Jan-2010
[1806]
Remember that 'user is a common script word, so that will be overwritten. 
Use module-local data, or port-specific data.
Graham
24-Jan-2010
[1807]
Eh?
BrianH
24-Jan-2010
[1808]
Certainly, set-net shouldn't set anything writeable any other way.
Graham
24-Jan-2010
[1809]
Moving on .... an AWS:// scheme can certainly be derived from the 
http scheme
BrianH
24-Jan-2010
[1810x2]
system/contexts/user is the shared "global" context for all user 
scripts (not modules), and that's why it's task-specific.
Maarten did so for Qtask, so I assume that strategy for aws:// would 
work here.
Graham
24-Jan-2010
[1812]
Umm.. he rewrote the http scheme I think
BrianH
24-Jan-2010
[1813]
Yeah. Which we need to do too.
Graham
24-Jan-2010
[1814x2]
Eh?  What's wrong with Gabriele's http scheme?
Anyway, Maarten had to do all of this because he chose to use the 
REST method of interacting with aws.  To it seems much simpler to 
use SOAP instead.
BrianH
24-Jan-2010
[1816x2]
Chunked encoding is broken, which is why the released version has 
been modded to use http 1.0; error handling is broken (the source 
of most chat errors); no server support; written for an older idea 
of R3 semantics.
Our HTTP scheme should work with REST out-of-the-box too.
Graham
24-Jan-2010
[1818x2]
I haven't used the prot-http ...
Is Gabriele ever coming back to work on any R3 stuff ?  Or is he 
a permanent qtask person now?
BrianH
24-Jan-2010
[1820]
It's next on my list after 2.7.8 and R3 compressed modules/scripts.
Graham
24-Jan-2010
[1821x2]
Yes, I'm sure it will work with REST ... it's just harder to maintain 
the aws interface each time they change their specifications
So, I suspect it's easier to maintain using SOAP
BrianH
24-Jan-2010
[1823]
I don't use their services (yet) so I wouldn't know.
Graham
24-Jan-2010
[1824x3]
Well I was reading their API again over the weekend on the plane 
:)
The main issue is that SOAP has to be over https ... so have to use 
stunnel ... that is if i can get stunnel working under windows 7
And if someone wants REST ... they can do it later on.
Pekr
24-Jan-2010
[1827]
I would like to ask about the inner workings of port actors. How 
is it done? Let's say you define 'read actor for port. Does it mean, 
that call to "read tcp://x.x.x.x" will then pass call to port 'read 
actor?
Graham
24-Jan-2010
[1828]
read scheme:// 
means that you call the scheme's actor 'read
Pekr
24-Jan-2010
[1829]
OK, but how does the native as 'read knows, what to do, if it is 
passed a port type? It is done somewhere in low level? In other words 
- which functions can be overriden that way?
Graham
24-Jan-2010
[1830x9]
'read checks to see if it is a port!, and then looks up the scheme
I read this somewhere ....
Alas my index is worse than that for the r3 docs
I don't know what the possible actors are, but I think they're the 
ones related to series.
Maybe the way to find out is to create a dummy scheme and implement 
as many dummy actors you can think of and then test them....
One of the issues with AWS is all the XML .. but I think we don't 
need a fancy XML parser .. .as it's pretty basic stuff.
Managed my first request to the Amazon SDB using the http scheme 
and SOAP
They say HTTPS is obligatory, but i used http and it was still accepted.
payload: create-sdb-message "ListDomains" listDomains 10


result: to-string write http://sdb.amazonaws.comcompose [ POST [ 
Content-Type: {text/xml; charset="utf-8"} SOAPaction: "ListDomains"] 
(payload) ]
Steeve
25-Jan-2010
[1839x2]
Possible actors are the functions accepting a port! as an input.
(obviously...)
Graham
25-Jan-2010
[1841]
good point!
Pekr
25-Jan-2010
[1842]
ah, thanks Steeve, that makes sense. It is nice that we can overload 
those functions ....
Graham
25-Jan-2010
[1843x2]
A couple of prototype functions for Amazon SDB
http://rebol.wik.is/Rebol3/AWS
Successfully created a couple of domains, and then listed them.
Gregg
25-Jan-2010
[1845]
Nice Graham.
Graham
25-Jan-2010
[1846x4]
SOAP looks much easier to implement compared with the tricky stuff 
you have to do with REST.
I haven't looked at the other services for a while now, and don't 
think I ever looked at the SOAP api for S3, and SQS .. but I suspect 
it's very similar, and just point the URL to a different service
What would be nice would be a small tight library for dealing with 
basic XML
Not suggesting that anyone write an XSD parser!