[
https://issues.apache.org/jira/browse/JENA-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254633#comment-13254633
]
Henry Story commented on JENA-203:
----------------------------------
I think the correct data structure to look at is the Iteratee one from
Functional programming.
Here I wrote an RDFIteratee trait that has two implmenetations: one synchronous
( JenaSyncRDFIteratee ) and the other asynchronous ( JenaRdfXmlAsync )
https://github.com/bblfish/Play20/blob/webid/framework/src/webid/src/main/scala/webid/rdf/RDFIteratee.scala
This can then be used to write some very elegant code which can evolve as one
gets better asynchronous parsers come along
https://github.com/bblfish/Play20/blob/webid/framework/src/webid/src/main/scala/webid/GraphCache.scala#L133
More documentation on Iteratees
https://github.com/playframework/Play20/wiki/Iteratees
Henry
> support for Non Blocking Parsers
> --------------------------------
>
> Key: JENA-203
> URL: https://issues.apache.org/jira/browse/JENA-203
> Project: Apache Jena
> Issue Type: Improvement
> Reporter: Henry Story
>
> In a Linked Data environment servers have to fetch data off the web. The
> speed at which such data
> is served can be very slow. So one wants to avoid using up one thread for
> each connections (1 thread =
> 0.5 to 1MB approximately). This is why Java NIO was developed and why servers
> such as Netty
> are so popular, why http client libraries such as
> https://github.com/sonatype/async-http-client are more
> and more numerous, and why framewks such as http://akka.io/ which support
> relatively lightweight
> actors (500 bytes per actor) are growing more viisible.
> Unless I am mistaken the only way to parse some content is using methods that
> use an
> InputStream such as this:
> val m = ModelFactory.createDefaultModel()
> m.getReader(lang.jenaLang).read(m, in, base.toString)
> That read call blocks. Would it be possible to have an API which allows
> one to parse a document in chunks as they arrive from the input?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira