Saturday, October 10, 2009
Changing Preon Modules
I know this could be painful, but I will go ahead and do it anyway. The last couple of weeks I spent some of my sparetime to work on a capability for outputting data from Preon. And I planned to support streaming output first. Now, that requires a couple of new abstractions that I first added to a module called preon-bitchannel. But I think I'm going to collapse preon-bitbuffer and preon-bitchannel into one new module: preon-io.

The two abstractions for reading bit'stream' type of content are just so intertwined that it hardly makes sense to have two different modules for it. For instance, one of the capabilities that will turn up in BitBuffer is the capability to 'stream' content directly to an output channel.
Now, why is this important? It's a little hard to explain, but I will give it a go. First of all, you should be aware of the fact that Preon is loading data lazily. That means that - in some cases - rather than loading data aggressively, it will keep a pointer to a position in the BitBuffer, and only start reading from that position if the application is actually accessing that data. Now, if you would be able to update data, but you would leave that specific segment untouched, then encoding would be as simple as writing from the BitBuffer directly to the output channel. And an implementation could do that extremely efficiently if the buffer and channel abstractions are designed to work with each other.
Any way, a code example probably would help a lot in this case. Sit tight. Something is coming.
Changing Preon Modules
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment