Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dnachbaur
Copy link
Contributor

@dnachbaur dnachbaur commented Dec 9, 2016

Use case:

  1. Proper support for registering the "stream-to" endpoint for Deflect streaming in brayns by reusing the same serializable from Lexis, but with a different name that in the end shows up in the python notebooks.
  2. The hyphenated URL is used as the method/object name in python instead of the generated typename from the schema.

I wasn't sure of creating (another!) overload for handle/handlePUT/handleGET with the customizable event name or what I did now with the default parameter to not break the API. Let me know what you prefer.

Copy link

@rdumusc rdumusc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I prefer having the second parameter as you did instead of a bunch more overloads.

* Handle PUT and GET for the given object.
*
* @param object the object to update and serve on receive()
* @param event uses this as the URL endpoint instead of the default
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 'use', not 'uses'. I also don't find 'event' very clear, but I don't know have a good suggestion. maybe 'address' or something like 'httpPath'?


bool handlePUT( servus::Serializable& serializable )
bool handlePUT( servus::Serializable& serializable,
const std::string& event )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/event/endpoint/

serializable.getSchema(), func );
}

bool handleGET( std::string event, const std::string& schema,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

endpoint

*/
ZEROEQHTTP_API bool handlePUT( servus::Serializable& object );
ZEROEQHTTP_API bool handlePUT( servus::Serializable& object,
const std::string& event = std::string( ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overloads with (endpoint, object)

@dnachbaur
Copy link
Contributor Author

Updated

* servus::Serializable::getTypeName()
*/
ZEROEQHTTP_API bool handleGET( const std::string& endpoint,
servus::Serializable& object );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const ..& object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@eile eile merged commit 2e457a8 into HBPVIS:master Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants