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

Version Path
auser-poolparty-1.3.0 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.1 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.10 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.11 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.12 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.13 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.14 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.15 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.16 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.17 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.2 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.3 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.4 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.5 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.6 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.7 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
auser-poolparty-1.3.8 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
fairchild-poolparty-1.3.17 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
fairchild-poolparty-1.3.5 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl
poolparty-1.3.15 examples/thrift/erlang/deps/thrift/src/thrift_transport.erl