loopholelabs/frisbee-go

Provide users ability to choose what messages to listen for in router

Closed this issue · 0 comments

MOVE TO https://github.com/loopholelabs/frisbee-rpc

In the current implementation of frisbeeGen we have stubs like this

handleFun(){
  panic("err")
}

for when a client/server handler interface exists for a method. We should create a way for users to opt out of handling certain methods so they dont need to stub out methods like this.

The approach should be as follows:
cli args that can prevent a handler func from being generated (altho depending on design patterns we want to enforce, this may not be ideal.

A better approach (altho we can do both) is to have the routerConstructor take in an optional list of methods that the user wants the router to handle with it defaulting to handling all handler functions in the interface.

The reason I'm hesitant to allow customization of the generated Interfaces is that I can see say one entire pub/sub cluster using a shared schema package to keep things consistent. I like that pattern of having a single package for a systen’s schema and frisbeeGen files. If we make the available handlers in an interface a subset of all handlers, this pattern doesnt work