anchor.diff:  			| term().
   %% ====================================================================
   
  -terminate(_Reason, #state{network = Net}) when Net /= undefined ->
  +terminate(_Reason, #vsstate{network = Net}) when Net /= undefined ->
   	{Connection, ChannelIn, ChannelOut} = Net,
   	amqp_channel:close(ChannelIn),
   	amqp_channel:close(ChannelOut),
  
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: 
  
  
  %% spec of record vsstate:
  %% {string(), [{atom(),string()}], binary(), {pid(), pid(), pid()}, atom()}
  -record(vsstate, {vstreamid, datapoints, exchange, network, function, log, history_size, last_updated}).
  
  
  
  