Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lambda-based builders for messages #16

Open
leveretka opened this issue Oct 26, 2018 · 9 comments
Open

Add lambda-based builders for messages #16

leveretka opened this issue Oct 26, 2018 · 9 comments

Comments

@leveretka
Copy link

Hi!

First of all, I really appreciate what you have done. This is the library I was really waiting for. I was thinking of implementing sth similar on salesforce generators and found you'd already done it.

I will be very glad to contribute and help you with this project. I would like to generate some helpful methods to reduce the boilerplate. For example, creating messages using lambdas instead of builders.
For example,

Record { id = someId author = someAuthor content = someContent votes = some.Votes }

What do you think? I have an idea how to do it.

I am also thinking of extending the readme with more examples and write more or less complex demo-app.

And if you have any ideas, how I can help you, I am happy to hear them.

@wfhartford
Copy link
Contributor

I would love this feature, but I don't think that this is the appropriate project to implement it. This generates a Kotlin flavour of the gRPC services. What you're discussing is not directly related to gRPC, but rather relates to the protobuf message classes which are generated by the protocol buffer compiler. It seems to me like a message building DSL would be best implemented as a separate protoc plugin.

@rouzwawi
Copy link
Owner

Hi! Nice to see more people finding this project useful :)

I’d be really happy to get contributions, so please go ahead. Nicer builders for proto messages has been on my todo list, so it’s definitely a welcome contribution if you want to pick that up 👍

Same for more examples. I got a chat-server example from some colleagues that I might put up here. If you have other thing please open PR’s.

Cheers!

@rouzwawi
Copy link
Owner

@wfhartford is true that protobuf builders are not tied to grpc, but they are the basis of grpc so it would be a good fit in this project. I think it can easily be built as a separate generator that one can use independent of the grpc generator.

@rouzwawi
Copy link
Owner

It’s also worth checking out this project https://github.com/cretz/pb-and-k

Seems like the aim is to generate multi-platform protobuf messages which is interesting considering preparing for #11

@leveretka
Copy link
Author

Hi! Sorry for the late reply. Are you going to use this project https://github.com/cretz/pb-and-k for preparation to multiplatform? I can try to talk to them as well. But as far as I understand now you are using classes generated by salesforce generator. So we can add builders here too. I think I will have some time to play with it in a few days. btw, have you seen this project https://github.com/marcoferrer/kroto-plus

One more thing. I recently had a talk "Building microservices with Kotlin and gRPC". Unfortunately, your project was a little scary to use at that point (few commits, 1 contributor, 0.0.2 version and a warning in a Readme) But for now, I am going to update my slides and code with your lib. So I can promote this lib at the conferences and find more users and contributors. Wdyt?

Here you can find my slides https://docs.google.com/presentation/d/14mPyoyXRWVtc241x4OxEm-KaaUJx8WaybHlXodrtcrM/edit?usp=sharing

@rouzwawi
Copy link
Owner

@leveretka I'm still gathering various resources about how multiplatform Kotlin works, there's a several technologies that need to mix and they're "multiplatform" each in their own way. So at the moment I don't know, just trying to wrap my head around it :)

I've seen kroto-plus and it looks very promising. The message builder generator is very similar to what you're asking for. Maybe that plugin can be used in conjunction with this project to get both. Have you tried it?

And I'd be super happy if you want to promote this lib in your talk. I've removed the warning from the readme and started to more actively spend time on this project now. It would be awesome to get get some more people to use it 👍

@leveretka
Copy link
Author

Cool! So I will update a bit my demo and talk. Will have a talk on 23-24 of November at Devoxx UA and then in Poland at JUG on 9-10 of January. So will try to gather more people here :)

As for Kroto-plus, actually yes the idea is from that project. I can try to combine and play with it.

As for multiplatform, I am still a novice there, so need more time to investigate.

@rouzwawi
Copy link
Owner

rouzwawi commented Nov 3, 2018

@leveretka Check out the latest updates on server-streaming calls in the Readme. Just so that your slides are up to date with the recent change of returning ReceiveChannel rather than extending ProducerScope.

@asad-awadia
Copy link

@leveretka Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants