<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Steve Vinoski's Blog &#187; web</title>
	<atom:link href="http://steve.vinoski.net/blog/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://steve.vinoski.net/blog</link>
	<description>Ask forgiveness, not permission.</description>
	<lastBuildDate>Sat, 17 Jul 2010 18:01:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A Chat Application in Lift</title>
		<link>http://steve.vinoski.net/blog/2010/05/06/a-chat-application-in-lift/</link>
		<comments>http://steve.vinoski.net/blog/2010/05/06/a-chat-application-in-lift/#comments</comments>
		<pubDate>Thu, 06 May 2010 22:55:46 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[column]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[lift]]></category>

		<guid isPermaLink="false">http://steve.vinoski.net/blog/?p=604</guid>
		<description><![CDATA[For the May/June issue of &#8220;The Functional Web&#8221; column in Internet Computing magazine, I&#8217;m fortunate to have David Pollak, creator of the Lift web framework, as a co-author. There&#8217;s a fair bit of code in this column, which I always like, and it&#8217;s worth looking at just to see how brief but powerful Lift and [...]]]></description>
			<content:encoded><![CDATA[<p>For the <a href="http://www.computer.org/portal/web/csdl/abs/mags/ic/2010/03/mic201003toc.htm">May/June issue</a> of <a href="/blog/internet-computing-columns/">&#8220;The Functional Web&#8221; column</a> in <a href="http://computer.org/internet">Internet Computing magazine</a>, I&#8217;m fortunate to have <a href="http://blog.lostlake.org/">David Pollak</a>, creator of <a href="http://liftweb.net/">the Lift web framework</a>, as a co-author. There&#8217;s a fair bit of code in this column, which I always like, and it&#8217;s worth looking at just to see how brief but powerful Lift and <a href="http://www.scala-lang.org/">Scala</a> can be in the hands of a master like David.</p>
<p>As always, feedback welcomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.vinoski.net/blog/2010/05/06/a-chat-application-in-lift/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WS-REST 2010 Program Online</title>
		<link>http://steve.vinoski.net/blog/2010/03/23/ws-rest-2010-program-online/</link>
		<comments>http://steve.vinoski.net/blog/2010/03/23/ws-rest-2010-program-online/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 06:32:29 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[conference]]></category>

		<guid isPermaLink="false">http://steve.vinoski.net/blog/?p=568</guid>
		<description><![CDATA[The program for the First International Workshop on RESTful Design (WS-REST 2010) is now online. As a member of the program committee I helped review submissions, and the ones I read were generally of pretty good quality, so I&#8217;m confident this will turn out to be a worthwhile workshop.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://ws-rest.org/Program">program</a> for the <a href="http://ws-rest.org/">First International Workshop on RESTful Design (WS-REST 2010)</a> is now online. As a member of the <a href="http://ws-rest.org/PC">program committee</a> I helped review submissions, and the ones I read were generally of pretty good quality, so I&#8217;m confident this will turn out to be a worthwhile workshop.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.vinoski.net/blog/2010/03/23/ws-rest-2010-program-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Column on Webmachine</title>
		<link>http://steve.vinoski.net/blog/2010/03/15/new-column-on-webmachine/</link>
		<comments>http://steve.vinoski.net/blog/2010/03/15/new-column-on-webmachine/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 06:19:06 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[HTTP]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://steve.vinoski.net/blog/?p=554</guid>
		<description><![CDATA[&#8220;The Functional Web&#8221; column is finally back, this time with a column about Webmachine co-authored with Justin Sheehy. The column title is Developing RESTful Web Services with Webmachine, and you can follow that link to retrieve the PDF. Webmachine is a highly innovative web application framework, and it can teach you a great deal about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="blog/internet-computing-columns/">&#8220;The Functional Web&#8221;</a> column is finally back, this time with a column about <a href="http://webmachine.basho.com/">Webmachine</a> co-authored with <a href="http://blog.therestfulway.com/">Justin Sheehy</a>. The column title is <a href="blog/internet-computing-columns/#2010-2"><em>Developing RESTful Web Services with Webmachine</em></a>, and you can follow that link to retrieve the PDF.</p>
<p>Webmachine is a highly innovative web application framework, and it can teach you a great deal about the specifics of HTTP and the details of REST. It&#8217;s also written in Erlang, which continues to be my favorite programming language of all time because of its incredible practicality, utility, and elegance.</p>
<p>My column hiatus was due to extreme startup workload, which for better or worse is showing no sign of letting up anytime soon. But it&#8217;s nice to get the column back on track for the <a href="http://www.computer.org/portal/web/csdl/abs/mags/ic/2010/02/mic201002toc.htm">March/April Internet Computing issue</a>, and one of my goals is to avoid missing any more issues this year. Many thanks to Justin for his contribution to this issue of the column.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.vinoski.net/blog/2010/03/15/new-column-on-webmachine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Yaws 1.85 Released</title>
		<link>http://steve.vinoski.net/blog/2009/10/19/yaws-1-85-released/</link>
		<comments>http://steve.vinoski.net/blog/2009/10/19/yaws-1-85-released/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 22:52:59 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[HTTP]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[yaws]]></category>

		<guid isPermaLink="false">http://steve.vinoski.net/blog/?p=484</guid>
		<description><![CDATA[Today Klacke announced Yaws 1.85, mainly a bugfix release. You can find the list of changes and fixes at that link, but one addition in this release I wanted to point out was our new streamcontent_from_pid feature, which allows your server application code to temporarily take over the client connection socket from Yaws, thus allowing [...]]]></description>
			<content:encoded><![CDATA[<p>Today Klacke announced <a href="http://yaws.hyber.org/">Yaws 1.85</a>, mainly a bugfix release. You can find the list of changes and fixes at that link, but one addition in this release I wanted to point out was our new <code> streamcontent_from_pid</code> feature, which allows your server application code to temporarily take over the client connection socket from Yaws, thus allowing you to feed data directly to the socket without first passing it back through Yaws. Could be just the ticket for long-polling (Comet) applications, for example.</p>
<p>Prior to this release, the closest feature Yaws provided for this sort of operation was the <code>streamcontent</code> capability, which is still very useful in that it allows you to have an Erlang process deliver data back into Yaws, which in turn sends it in HTTP chunked transfer mode back to the client. For large file resources like video files or install tarballs, or for data sources where content arrives at your server in batches from a separate back-end source, or generally for resources whose sizes are not known up front, <code>streamcontent</code> is perfect because it lets you transfer the data back into Yaws in chunks, at your leisure and without having to copy all the data at once. Still, though, the data has to be sent back through Yaws, which converts it to HTTP chunks and writes it to the socket, plus in this case your only choice is chunked transfer.</p>
<p>With <code>streamcontent_from_pid</code>, you reply to the <code>out/1</code> upcall from Yaws with the HTTP reply headers and with the following special return tuple:</p>
<pre><code>{streamcontent_from_pid, MimeType, StreamPid}</code></pre>
<p>This tells Yaws that you wish to have process <code>StreamPid</code> take over the client socket in order to send data of media type <code>MimeType</code> directly back to the client. Yaws uses <code>MimeType</code> to set the HTTP <code>Content-Type</code> header, and then after sending that and all the other HTTP headers back to the client, it turns control of the client socket over to <code>StreamPid</code>. The code running within <code>StreamPid</code> must handle the following messages from Yaws:</p>
<ul>
<li><code>{ok, YawsPid}</code> tells <code>StreamPid</code> that it can proceed with using the socket. The socket is present in the original <code>Arg</code> variable passed to your <code>out/1</code> function and can be retrieved via <code>Arg#arg.clisock</code>.</li>
<li><code>{discard, YawsPid}</code> tells <code>StreamPid</code> that it shouldn&#8217;t send any data on the socket, for example because the client request was an HTTP <code>HEAD</code> request and so there is no response body.</li>
</ul>
<p>To send data, your code can choose to send chunked data or non-chunked data. To send the latter, first make sure you set the HTTP <code>Content-Length</code> header in your initial reply to Yaws, and then once Yaws calls back to your <code>StreamPid</code> process, just call:</p>
<pre><code>yaws_api:stream_process_deliver(Socket, IoList)</code></pre>
<p>or for chunked data:</p>
<pre><code>yaws_api:stream_process_deliver_chunk(Socket, IoList)</code></pre>
<p>where for both cases <code>Socket</code> is the client socket from the <code>Arg</code> and <code>IoList</code> is an iolist containing the data to be sent. The first case just calls <code>gen_tcp:send</code> and is there primarily so we can maybe someday add SSL socket support for this feature. For the second case Yaws will format the data for you for chunked transfer. Unless a <code>Content-Length</code> header is set, Yaws will assume you want chunked transfer and will set the <code>Transfer-Encoding</code> header appropriately. If you&#8217;re sending chunked data, make sure you send your final chunk using the following function:</p>
<pre><code>yaws_api:stream_process_deliver_final_chunk(Socket, IoList)</code></pre>
<p>so that Yaws knows to send the termination chunk to inform the client of the end of the transfer.</p>
<p>You can continue to call these functions from your <code>StreamPid</code> as frequently as you need to in order to deliver your data to the client. Meanwhile, the Yaws process that handed you the socket will just sit back and wait for you (non-blocking, of course). When you&#8217;re completely finished sending, just call:</p>
<pre><code>yaws_api:stream_process_end(Socket, YawsPid)</code></pre>
<p>to end the transmission and give control of the socket back to Yaws. At that point, your <code>StreamPid</code> can exit if it wishes.</p>
<p>If you try out this feature, be sure to send feedback either to me or to the <a href="https://lists.sourceforge.net/lists/listinfo/erlyaws-list">Yaws mailing list</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.vinoski.net/blog/2009/10/19/yaws-1-85-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Column: Build Your Next Web App with Erlang</title>
		<link>http://steve.vinoski.net/blog/2009/07/25/new-column-build-your-next-web-app-with-erlang/</link>
		<comments>http://steve.vinoski.net/blog/2009/07/25/new-column-build-your-next-web-app-with-erlang/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 02:12:10 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[column]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://steve.vinoski.net/blog/?p=463</guid>
		<description><![CDATA[The latest &#8220;Functional Web&#8221; column is now available. It&#8217;s entitled &#8220;Build Your Next Web Application with Erlang,&#8221; (PDF) and my co-author this time was Dave Bryson of BeepBeep fame. Over the past year or two there&#8217;s been a sharp increase in development efforts in the Erlang web framework space, as a number of folks, ourselves [...]]]></description>
			<content:encoded><![CDATA[<p>The latest &#8220;<a href="/blog/internet-computing-columns/">Functional Web&#8221;</a> column is now available. It&#8217;s entitled &#8220;<a href="/pdf/IC-Build_Your_Next_Web_Application_with_Erlang.pdf">Build Your Next Web Application with Erlang</a>,&#8221; (PDF) and my co-author this time was <a href="http://weblog.miceda.org/">Dave Bryson</a> of <a href="http://github.com/davebryson/beepbeep/">BeepBeep</a> fame. Over the past year or two there&#8217;s been a sharp increase in development efforts in the Erlang web framework space, as a number of folks, ourselves included, have found that Erlang works really well for server-side web development. In this column Dave and I provide an introduction to a number of Erlang web frameworks and servers. Future columns will dig into some of these in much more detail.</p>
<p>My thanks to Dave for his efforts on this column; he was a sheer pleasure to work with. If Dave ever invites you to co-author something, whether it&#8217;s an article or some code, I recommend you take him up on his offer.</p>
<p>P.S. Sorry for the quiet blog lately &mdash; it&#8217;s just that I have a whole lot of work on my plate these days.</p>
]]></content:encoded>
			<wfw:commentRss>http://steve.vinoski.net/blog/2009/07/25/new-column-build-your-next-web-app-with-erlang/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
