public void run() { try { string csdl = "interaction.type == \"twitter\" and interaction.sample <= 1.0"; m_form.deletesLog("Creating definition..."); m_form.deletesLog(" " + csdl); Definition def = m_form.user.createDefinition(csdl); m_form.deletesLog("Creating consumer..."); m_consumer = def.getConsumer(this, "http"); m_form.deletesLog("Consuming..."); m_consumer.consume(); } catch (Exception e) { m_form.deletesLog(e.GetType().ToString() + ": " + e.Message); if (m_consumer != null) { m_consumer.stop(); } } }
public void onInteraction(StreamConsumer consumer, Interaction interaction, string hash) { try { m_form.deletesLog(".", false); } catch (Exception e) { m_form.deletesLog(e.GetType().ToString() + ": " + e.Message); } }
public void onDeleted(StreamConsumer consumer, Interaction interaction, string hash) { try { m_form.footballLog("Delete request for interaction " + interaction.getStringVal("interaction.id") + " of type " + interaction.getStringVal("interaction.type")); m_form.footballLog("Please delete it from your archive."); m_form.footballLog("--"); } catch (Exception e) { m_form.footballLog(e.GetType().ToString() + ": " + e.Message); } }
public void onDeleted(StreamConsumer consumer, Interaction interaction, string hash) { try { m_form.deletesLog("X", false); m_count--; if (m_count == 0) { m_form.deletesLog("\r\n\r\nStopping consumer..."); consumer.stop(); } } catch (Exception e) { m_form.deletesLog(e.GetType().ToString() + ": " + e.Message); } }
public void onInteraction(StreamConsumer consumer, Interaction interaction, string hash) { try { m_form.footballLog("Type: " + interaction.getStringVal("interaction.type")); m_form.footballLog("Content: " + interaction.getStringVal("interaction.content")); m_form.footballLog("--"); m_count--; if (m_count == 0) { m_form.footballLog("Stopping consumer..."); consumer.stop(); } } catch (Exception e) { m_form.footballLog(e.GetType().ToString() + ": " + e.Message); } }
public void run() { try { string csdl = "interaction.content contains \"football\""; m_form.footballLog("Creating definition..."); m_form.footballLog(" " + csdl); Definition def = m_form.user.createDefinition(csdl); m_form.footballLog("Creating consumer..."); m_consumer = def.getConsumer(this, "http"); m_form.footballLog("Consuming..."); m_consumer.consume(); } catch (Exception e) { m_form.footballLog(e.GetType().ToString() + ": " + e.Message); } }
/// <summary> /// Get a StreamConsumer object for the given stream hash. /// </summary> /// <param name="hash">The stream hash.</param> /// <param name="event_handler">The object that will receive events.</param> /// <param name="type">The type of StreamConsumer required.</param> /// <returns>A StreamConsumer object.</returns> public StreamConsumer getConsumer(string hash, IEventHandler event_handler, string type = "http") { return(StreamConsumer.factory(this, type, new Definition(this, null, hash), event_handler)); }
public void onWarning(StreamConsumer consumer, string message) { m_form.deletesLog("\r\nWARN: " + message); }
public void onConnect(StreamConsumer consumer) { m_form.deletesLog("Connected"); m_form.deletesLog("--"); }
public void onDisconnect(StreamConsumer consumer) { m_form.footballLog("Disconnected"); m_form.footballLog("--"); m_form.resetFootballStartButton(); }
public void onError(StreamConsumer consumer, string message) { m_form.deletesLog("\r\nERR: " + message); }
public void onWarning(StreamConsumer consumer, string message) { m_form.footballLog("WARN: " + message); m_form.footballLog("--"); }
public void onConnect(StreamConsumer consumer) { m_form.footballLog("Connected"); m_form.footballLog("--"); }
/// <summary> /// Get a StreamConsumer object for the given array of stream hashes. /// </summary> /// <param name="hashes">The array of stream hashes.</param> /// <param name="event_handler">The object that will receive events.</param> /// <param name="type">The type of StreamConsumer required.</param> /// <returns>A StreamConsumer object.</returns> public StreamConsumer getMultiConsumer(string[] hashes, IEventHandler event_handler, string type = "http") { return(StreamConsumer.factory(this, type, hashes, event_handler)); }
public void onDisconnect(StreamConsumer consumer) { m_form.deletesLog("\r\nDisconnected"); m_form.resetDeletesStartButton(); }
/// <summary> /// Get a consumer object of the given type for this Definition. /// </summary> /// <param name="event_handler">An object that implements the IEventHandler interface.</param> /// <param name="type">The consumer type required.</param> /// <returns>An instance of a class derived from StreamConsumer.</returns> public StreamConsumer getConsumer(IEventHandler event_handler, string type = "http") { return(StreamConsumer.factory(m_user, type, this, event_handler)); }
public void onError(StreamConsumer consumer, string message) { m_form.footballLog("ERR: " + message); m_form.footballLog("--"); }