goloveychuk / ZeroMQ

ZeroMQ for Swift
MIT License
92 stars 29 forks source link

adapt 3 swift #16

Closed goloveychuk closed 8 years ago

0xafbf commented 8 years ago

I am no mantainer, but I'd definitely merge this =D Edit: just tried copying the example in the readme, but it didn't work because the enums in the readme are capitalized (i.e. ".Push" should be ".push")

0xafbf commented 8 years ago

Hello, I am not familiar with the Zewo project but I'm currently using ZeroMQ in swift with goloveychuk's fork. I am no expert but I feel some changes should not be made, mainly to avoid introducing external dependencies. In my case I am using ZeroMQ for connecting a desktop and mobile app, so I wouldn't use other Zewo services and would prefer if I didn't have to include them at all. I don't know what the Axis API does, but if you suggest that it should be used, I think that the Axis repo would be a better place to implement this with an extension, or in ZeroMQ with the canImport conditional flag, so there is always a way to use ZeroMQ without depending on Axis

goloveychuk commented 8 years ago

Yea, I agree with @BoteRock . If we can easily avoid dependence, why we shouldn't

goloveychuk commented 8 years ago

oops, I don't know why it's merged :) upd: I made git push, forgot that origin is zewo repo

Danappelxx commented 8 years ago

@BoteRock @goloveychuk What's the issue with using Axis? It's the common code used by all zewo modules. It's not really external dependency, it doesn't bring in anything opinionated (ie libmill) - just a bunch of protocols and utilities. Without it, it's difficult to use ZeroMQ with, for example, HTTPServer (you can't do things like stream the 0mq socket to the client without a bunch of glue if you don't conform to the Stream protocol). The only thing we need out of there is buffer and stream.

That said, I'm not entirely against having ZeroMQ be an outlier. What are your reasons for not wanting to include Axis?

@goloveychuk that's alright, this pr is pretty much ready anyway. Can you update the readme as well please?

vovasty commented 8 years ago

@Danappelxx for this 0mq implementation Axis is not really needed. This is just a simple wrapper.

Danappelxx commented 8 years ago

Axis is not foundation - its not a toolkit. It's just the glue for compatibility with the rest of the ecosystem. The fact that JSON and such are included in Axis is something I disagree heavily with and will be changed by the next release (0.15). Perhaps once that happens we can add it as a dependency here.

goloveychuk commented 8 years ago

@Danappelxx I understand what you want, but zeromq is not simple socket. You cannot just use it as transport. It have many types of sockets, support many patterns. There are many limitations. E.g. you will error if will try to read from req/rep socket, while you should write to it. If somebody want it combine with axis - it will require writing a wrapper.

vovasty commented 8 years ago

you, guys, forgot about this one https://github.com/Zewo/Canale this is specifically developed for Zewo & friends.