blob: 0044b832ace1d5c0a31ce5e1d9f46e2de3b830d0 [file] [log] [blame]
David Reiss6d477592008-06-11 01:12:09 +00001-module(test_disklog).
2
3-compile(export_all).
4
5t() ->
6 {ok, TransportFactory} =
7 thrift_disk_log_transport:new_transport_factory(
8 test_disklog,
9 [{file, "/tmp/test_log"},
10 {size, {1024*1024, 10}}]),
11 {ok, ProtocolFactory} = thrift_binary_protocol:new_protocol_factory(
12 TransportFactory, []),
13 {ok, Client} = thrift_client:start_link(ProtocolFactory, thriftTest_thrift),
14
15 io:format("Client started~n"),
16 % We have to make async calls into this client only since otherwise it will try
17 % to read from the disklog and go boom.
18 {ok, ok} = thrift_client:call(Client, testAsync, [16#deadbeef]),
19 io:format("Call written~n"),
20
21 ok = thrift_client:close(Client),
22 io:format("Client closed~n"),
23
24 ok.
25