[nanomsg] Re: more updates

  • From: Garrett D'Amore <garrett@xxxxxxxxxx>
  • To: Ondrej Kupka <ondra.cap@xxxxxxxxx>
  • Date: Tue, 22 Apr 2014 12:12:25 -0700

Sounds good.  I'm going to give it a shot.  I've already prototyped some of 
these changes for my star protocol.  So far so good. 

I'm actually going to break this into a few packages:

mangos  Applications API
mangos/protocol  APIs for use by protocol implemented
mangos/protocol/star etc. specific protocol
mangos/protocol/all  imports all protocols.  (More useful for transports than 
protocols.  See below. )

Will do the same thing for transport. (mangos/transport/tcp etc.)

Sent from my iPhone

> On Apr 22, 2014, at 11:03 AM, Ondrej Kupka <ondra.cap@xxxxxxxxx> wrote:
> 
> 
>> On Apr 22, 2014, at 7:56 PM, Garrett D'Amore wrote:
>> 
>> (Sorry for those of you not using Go… maybe its getting to be time to spawn 
>> another mailing list. :-)
> 
> Yeah, we could do that :D
> 
>>> 
>>> I think that if you can do tcp.RegisterTransport(), you can also do this 
>>> from the tcp package in init(). You are probably talking about a scenario 
>>> where you need to do mangos.RegisterTransport(tcp.Transport()). Personally 
>>> I don't really have anything against having to write that… I mean yeah, it 
>>> is sort of unfortunate, but I don't know any better solution right now...
>> 
>> The problem is that doing it from the tcp package’s init() routine isn’t 
>> strictly sufficient, because if I don’t have any reference to the tcp 
>> package from my application, then the Go compiler will complain about tcp 
>> being an unused import.
>> 
>>      - Garrett
> 
> I thought that doing
> 
> import (
>     _ "tcp"
> )
> 
> is exactly for the purpose of hidden initialization… It cancels the unused 
> import error. So in case all you need is to import mangos and call 
> RegisterFactory or so, you can do it in tcp's init and just ask the user to 
> use the import specified above.
> 
> Regards,
> Ondrej

Other related posts: