xsc / thrift-clj Goto Github PK
View Code? Open in Web Editor NEWThrift and Clojure!
Home Page: http://xsc.github.io/thrift-clj/
License: MIT License
Thrift and Clojure!
Home Page: http://xsc.github.io/thrift-clj/
License: MIT License
I'm fine playing around with structs, but when I add the following to the thrift file:
union Identity {
1: string email;
2: string ssn;
}
I can't instantiate the Identity union. It feels like I should be able to use:
(thrift/->thrift (map->Identity {:ssn "21582"}))
but this throws the error "Not an optional field: email"
Does the library currently support unions? If so, I'd be happy to add documentation to the readme.
Thanks for your great work!
I encountered a problem and not sure what is the reason. I am using :binary
protocol. It works well with Clojure server and client. But when trying with thriftpy client, it throws the error: cybin.ProtocolError: No protocol version header
.
Below is the python client code I am trying. It works with the Java thrift server, but not Clojure server with thrift-clj.
import thriftpy
from thriftpy.rpc import make_client
api_thrift = thriftpy.load("./idl/api.thrift", module_name="myapi_thrift")
api_service = make_client(api_thrift.AService, '192.168.0.2', 9011)
print api_service.ping()
In thrift IDL I have a struct with binary field
struct A {
1: binary field;
}
What is correct way to create this field on server side?
For example to create binary from int I use
(doto (ByteBuffer/allocate 4)
(.putInt (int 3))
(.array)))
First, thanks for the work on this project - very useful and clean API with good docs/tests!
quick question: In the later versions of thrift, one can inherit in thrift services. Are there any plans to support this in the (near) future? Currently I receive various errors about namespace collisions when I import e.g. two services with the same inherited "base" service.
Assuming I have a simple thrift struct
struct A {
1: string a;
2: i32 b;
}
Generated class A.java
have default constructor, but if I use (thrift/import (:types [A]))
no default constructor is available.
Though, it may be a useful as a restriction but prevent common way to fill java structure:
(doto (A.)
(.setA "some)
(.setB 42))
Please add how to actually run the server to the documentation
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.