anchor.diff:  	Timeout :: non_neg_integer() | infinity.
   %% ====================================================================
   handle_info({#'basic.deliver'{}, #amqp_msg{payload = Body}},
  -			State = #state{vstreamid = VStreamId, datapoints = DataPoints,
  -						   exchange = VStreamExchange, network = Net,
  -						   function = Function}) ->
  +			State = #vsstate{vstreamid = VStreamId, datapoints = DataPoints,
  +						     exchange = VStreamExchange, network = Net,
  +						     function = Function}) ->
   	Data = binary_to_list(Body),
   	case erlson:is_json_string(Data) of
   		%% New value from the source as a Json
  
positive.code: 					%% Publish the calculated value
  					ChannelOut = element(3, Net),
  					send(ChannelOut, VStreamExchange, list_to_binary(Msg)),
  					{noreply, State#state{datapoints = NewDataPoints,
  										  log = Log,
  										  history_size = NewHistorySize,
  										  last_updated = NewLastUpdated}}
  			end;
  		_ ->
  			{noreply, State}
  
negative.code: 					Log = case erlastic_search:index_doc(?ES_INDEX,
  														 "vsdatapoint", Msg) of
  						  	{error, _Reason} ->
  						  		NewLastUpdated = State#vsstate.last_updated,
  						  		NewHistorySize = State#vsstate.history_size,
  						  		%% TODO Persistent storage using file?
  								[Msg | State#vsstate.log];
  							{ok, _} ->
  								NewLastUpdated = Timestamp,
  								%% Try updating the vstream and storing the log
  								{L, S} = store_log_in_es(State#vsstate.log, 0),
  								NewHistorySize = State#vsstate.history_size + S + 1,
  								update_virtual_stream(State#vsstate.vstreamid,
  													  NewHistorySize,
  													  NewLastUpdated),
  								L
  