Skip to content
Noel Welsh edited this page Aug 10, 2012 · 3 revisions

Responses

We represent the responses you can get from Myna as subclasses of a Response class. You need to know what attributes are available on the subclasses to use the Myna client, so here they are:

Suggestion

When you ask Myna for a suggestion, this is what you get. Available attributes are:

  • choice. A String that is the name of the variant Myna suggests.
  • token. A String that you must send back to Myna to reward this suggestion.

Ok

A singleton, used to indicate successful completion of actions that have no useful result. Has no attributes.

Uuid

Has a single attribute uuid, a String representing a globally unique identifier.

Experiment

Contains information about an experiment. Has attributes

  • name. A String that is the name of the experiment.
  • uuid. A String that is the UUID of the experiment.
  • accountId. A String that is the UUID of the account that owns this experiment.
  • variants. An Array of Variants, described below.

Variant

Represent a variant within an experiment. Attributes are:

  • name. A String.
  • views. A Integer, the number of times this variant has been suggested (and hence viewed)
  • totalReward. A Float, the total reward this variant has received.
  • lowerConfidenceBound. A Float, a 95% confidence lower-bound on the average reward of this variant.
  • upperConfidenceBound. A Float, a 95% confidence upper-bound on the average reward of this variant.

MynaError

This subclass of Response is the superclass of all the error respones below.

ApiError

Represents an error that Myna sent back. Has attributes:

  • subtype. An Integer corresponding to the HTTP response code associated with this error. Usually in the 500-599 range.
  • messages. An Array of Arrays. The sub-arrays have keys typename and item, both return Strings, that give more information about the error.

NetworkError

Represents a error that occurred on the network. Has no attributes as I don't know how to get useful information out of EventMachine in this case.

Clone this wiki locally