thrift
Version, currently main branch1 version
- main branchlatestJul 12, 2024
github.com/kylepellham/thrift_cr
thrift library for crystal
Installation
# Add this to your shard.yml
dependencies:
thrift:
github: kylepellham/thrift_cr
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.5.1- License
- Apache 2.0
- Author
- Kyle Pellham
Dependencies
This version declares no dependencies.
README
thrift_cr
thrift_cr is library to be used in conjunction with apache thrift in order to use apache thrift generated crystal code
Installation
-
Add the dependency to your
shard.yml:dependencies: thrift: github: kylepellham/thrift_cr -
Run
shards install
Usage
require "thrift"
All library definitions exist in the namespace Thrift. Through Thrift you can initialize a server with a transport:
Thrift::Transport::ServerSocketTransport
and a protocol factory:
Thrift::Protocol::BinaryProtocolFactoryThrift::Protocol::JsonProtocolFactory
you can mix any factory with any server transport. When you use this library you are expected to use the thrift generation this is how you get a server processor for a service. When you get processor you can create one of the following servers:
Thrift::Server::SimpleServer
this is an example of creating and running a server:
server_transport = Thrift::Transport::Socket.new("localhost", 9090)
trans_factory = Thrift::Transport::SocketTransportFactory.new
prot_factory = Thrift::Protocol::BinaryProtocolFactory.new
# this would be generated from a thrift idl file
handler = MyHandler.new
processor = MyService::Processor(MyHandler).new(handler)
server = Thrift::Server::SimpleServer.new(processor, server_transport, trans_factory, prot_factory)
Contributing
- Fork it (https://github.com/kylepellham/thrift_cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Kyle Pellham - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Jul 12, 2024
- Crystal
1.5.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/kylepellham/thrift_cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1