facebookarchive / swift

An annotation-based Java library for creating Thrift serializable types and services.
Apache License 2.0
900 stars 297 forks source link

How dose AutoCloseable in Swift-Client work #342

Closed kwanCCC closed 7 years ago

kwanCCC commented 7 years ago

Swift Client

@ThriftService
public interface Pay extends AutoCloseable
{
    @ThriftMethod
     ResultCode pay(Object object);
}

public class PayImpl implements Pay{
    @Override
    public void close() throws Exception{
    }
}

Need I wirte something in the close() Or SwiftClient will help me recycle resource

kwanCCC commented 7 years ago

Anyone help me ?

saoxuequ commented 7 years ago

SwiftClient will help you recycle resource

electrum commented 7 years ago

Simply add the method to your interface and Swift will implement it for you (just like the other methods). When called, Swift will close the client socket.

kwanCCC commented 7 years ago

@electrum THX

kwanCCC commented 7 years ago

@SystemHan THX