lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Nov 20, 2020, at 16:01, Dmitry Meyer wrote:

> A buffet is an object that has the same interface as socket objects in 
> the popular Lua libraries LuaSocket and Lua Nginx Module but doesn't do 
> any real network communication. Instead the network stack the buffet 
> receives data from an arbitrary source. The data source can be a string, 
> a table of strings or an iterator function producing strings.
> 
> The buffet works in a streaming fashion. That is, the buffet doesn't try 
> to read and store internally the whole source data at once but reads as 
> little as possible and only when necessary. That means that the buffet 
> can be efficiently used as a proxy for sources of unlimited amounts of 
> data such as real sockets or file I/O readers.
> 
> Another possible use is unit testing where the buffet can be used as a 
> mock object instead of the real socket object.

Hello Dmitry,

this is interesting. Some of the goals kind of remind me with ltn12.
It would be interesting if you supported ltn12 source and sinks.

I can see certainly see myself using this for mocks someday.

-- 
Pierre Chapuis