Sha256: 40d205457be7912f05ae1c1232570edfe922839e4cf254c98f714529ced63e6c
Contents?: true
Size: 836 Bytes
Versions: 28
Compression:
Stored size: 836 Bytes
Contents
-module(thrift_transport). -export([behaviour_info/1]). -export([new/2, write/2, read/2, flush/1, close/1 ]). behaviour_info(callbacks) -> [{read, 2}, {write, 2}, {flush, 1}, {close, 1} ]. -record(transport, {module, data}). new(Module, Data) when is_atom(Module) -> {ok, #transport{module = Module, data = Data}}. %% Data :: iolist() write(Transport, Data) -> Module = Transport#transport.module, Module:write(Transport#transport.data, Data). read(Transport, Len) when is_integer(Len) -> Module = Transport#transport.module, Module:read(Transport#transport.data, Len). flush(#transport{module = Module, data = Data}) -> Module:flush(Data). close(#transport{module = Module, data = Data}) -> Module:close(Data).
Version data entries
28 entries across 28 versions & 3 rubygems