Skip to content

registering function as a service #68

@krisiasty

Description

@krisiasty

I would like to handle method names which are not in a form "Service.Method", whch seems currently imposible.

One way to handle this would be to have *(Server) RegisterFunc method accepting function and string with a method name as parameters.

Example usage:

func HeartBeat(r *http.Request, args *HeartBeatArgs, reply *HeartBeatReply) error {
    reply.TimeStamp = time.Now().UnixNano()
}

s := rpc.NewServer()
s.RegisterService(heartBeat, "heartBeat")

That way any call with method "heartBeat" should be directed to function HeartBeat.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions