Monday, November 08, 2010 at 12:00 AM.
river2Suite.cloudPipe.serverNewItem
on serverNewItem (urlfeed, adritem) {
<<Changes
<<12/24/09; 8:40:26 AM by DW
<<Created. Called on the server when a new item comes in. We check if anyone we're piping updates to is subscribed to the feed, if so we make a copy of the item to shoot over to them when they check.
local (adrdata = river2suite.init (), startticks = clock.ticks (), now = clock.now (), adruser);
for adruser in @adrdata^.users {
local (adrfeed = @adruser^.feeds.[urlfeed]);
river2Suite.initUser (adruser);
if defined (adrfeed^) {
local (adrsub = @adrfeed^.items.[string.padwithzeros (adrfeed^.itemSerialnum++, 4)]);
adrsub^ = adritem^;
adrfeed^.whenLastRealtimeUpdate = now;
adrfeed^.flRealtimeUpdate = true}}};
bundle { //test code
serverNewItem ("http://www.nytimes.com/services/xml/rss/userland/HomePage.xml", @scratchpad.feed.items.["011"])}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.