Giter Club home page Giter Club logo

colony's Introduction

bee

colony

A lightweight microservice framework for NSQ. Services can emit and consume data; services can also respond to messages they receive and handle response to messages they emit.

See the docs or the examples for more information.

colony's People

Contributors

mikedewar avatar nikhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colony's Issues

remove message type from Emit, assume type from Announce

I may not fully understand the use case, but if a Colony service announces a type it is producing, shouldn't Emit() always produce messages given by function Announce()? For example, if I declare my service is sending bees should I have to specify that each message of type bees

The exception here is if a service wants to produce different kinds of messages than what it emits, but I would say that affordance could be confusing.

I just used Emit() to send a message type different than what I announced and I am not sure that is desirable behavior.

hide Message fields

There are several fields in the Message type that are used by Colony internals, that if modified by a user, could create mayhem.

For instance, if a service could receive messages and change MessageID, Time, ContentType, Topic, etc, and "respond" and who knows where the message would go or what it would do. IMO, any field expressing state within Colony should be hidden or have some kind of getter.

why handlers?

When you Produce a message, you need to specify nil or some kind of function to handle the response.

However the Consumer returns a chan for messages to be consumed.

Could parity could be created by doing away with handlers entirely, and having colony.Message have a .C as well?

so:

m := s.NewMessage("bees",[]byte("bzzz"));
s.Produce(m, handler)

becomes

m := s.NewMessage("bees",[]byte("bzzz"));
s.Produce(m)
response := <-m.C

(would also be nice if Produce was renamed to Emit maybe?)

add ability for a colony service to clean up after itself

I wonder if it is a good idea to implement a method that would afford the ability for a Colony service to clean up after itself. Something like Stop() would remove the channels created in NSQ.

This would be especially helpful in the creation of things that are single-use services. For instance, if I am testing and I want to submit a single query and examine the response, I'd like this testing utility to remove channels/topics on exit.

Produce to Emit and Request

Produce currently accepts a message and a handler, but not all messages need handlers.

What abut
Emit(colony.Message) and Request(colony.Message, colony.HandlerFunc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.