Thrift client library for Microsoft .NET Standard
./ bootstrap && ./ configure && make
If you are migrating your code from netcore library, you will have to:
thrift -gen netstd
hashcode
is now standard, while nullable
is no longer supported.Thrift.Transport
and Thrift.Protocol
namespaces now use the singular formusing Thrift.Processor;
in the server code where appropriateT*ClientTransport
to T*Transport
TBaseServer
occurrences in your code to TServer
SingletonTProcessorFactory
is now called TSingletonProcessorFactory
AsyncBaseServer
is now the TSimpleAsyncServer
You may wonder why we changed so many names. The naming scheme has been revised for two reasons: First, we want to get back the established, well-known naming consistency across the Thrift libraries which the netcore library did not fully respect. Second, by achieving that first objective, we get the additional benefit of making migration at least a bit easier for C# projects.
Because of the different environment requirements, migration from C# takes slightly more efforts. While the code changes related to Thrift itself are moderate, you may need to upgrade certain dependencies, components or even modules to more recent versions.
thrift -gen netstd
. The following compiler flags are no longer needed or supported: hashcode
and async
are now standard, while nullable
is no longer supported.async/await
model, if you have not already done so. As netstd does not support ISync
anymore, async is mandatory. The synchronous model is simply no longer available (that‘s also the reason why we don’t need the async
flag anymore).cancellationToken
parameters. They are optional but may be quite helpful.using Thrift.Processor;
in the server code where appropriateTServerSocket
is now called TServerSocketTransport
IProtocolFactory
into ITProtocolFactory
TSimpleServer
, try TSimpleAsyncServer
insteadTThreadPoolServer
is now a TThreadPoolAsyncServer
Serve()
method does now ServeAsync()
SetEventHandler
method now starts with an uppercase letterTServerEventHandler
descendants you have in your code