You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a couple inconsistencies between Runnable API and documentationthat I wanted to document below to allow for tracking and further discussions.
There is a variety of set* methods in some languages (e.g. Rust) which are there to enable experimentation with runnables implementing some middleware-functionality. These are intentionally undocumented for now as the API ergonomy and usecases are developed.
In JavaScript the body method returns a JS string. and the bodyBytes method needs to be used to get the raw bytes. Other runtime seem to default to body returning the raw bytes.
The state method in every supported language seem to return the state key value as a string, JavaScript and some other languages also provide a "raw" method (state_raw or stateBytes) to get the raw bytes which is undocumented.
The text was updated successfully, but these errors were encountered:
In JS, the result of an HTTP request is a custom HttpResponse class, with methods text() to get the body as a string, json() for JSON, and arrayBuffer() for an ArrayBuffer. It was done this way to feel the most idiomatic for JS... Consistency across languages is tough. Ideally, the API provided by Reactr's interface would be "good enough" for each language. I have lots of thoughts about this that we should probably schedule some time to chat through.
As for state, I don't think that access to the raw bytes is particularly useful, and we should maybe remove it and standardize across the languages.
I noticed a couple inconsistencies between Runnable API and documentationthat I wanted to document below to allow for tracking and further discussions.
set*
methods in some languages (e.g. Rust) which are there to enable experimentation with runnables implementing some middleware-functionality. These are intentionally undocumented for now as the API ergonomy and usecases are developed.body
method returns a JSstring
. and thebodyBytes
method needs to be used to get the raw bytes. Other runtime seem to default tobody
returning the raw bytes.state
method in every supported language seem to return the state key value as a string, JavaScript and some other languages also provide a "raw" method (state_raw
orstateBytes
) to get the raw bytes which is undocumented.The text was updated successfully, but these errors were encountered: