ScalaDocs: Tweet Stream
|
|
com/twitter/processing/TweetStream.scala
]
class
TweetStream(parent : processing.core.PApplet, host : java.lang.String, port : Int, path : java.lang.String, username : java.lang.String, password : java.lang.String)
extends
LogType Summary | |
type
|
T
A structural type that defines a tweet(status: Status) method.
If our parent conforms to this type we can call back to it
|
Value Summary | |
val
|
VERSION
: java.lang.String
the version of the library
|
var
|
callbackApplet
: <refinement>
We'll attempt to cast parent and set callbackApplet.
If it stays null we don't callback. Note that this
makes initializing a TweetStream object sorta pointless.
|
var
|
client
: org.apache.http.impl.client.DefaultHttpClient
an Apache commons http client to use for communication
|
var
|
connectTimeMs
: Long
how long we've spent connecting
|
var
|
connectTimeoutMs
: Int
how long to wait for a connection
|
val
|
delimitedLength
: Boolean
whether we're using delimited length mode
|
var
|
delimitedReadStall
: Int
how many times we've stalled trying to read length delimited content
|
var
|
disconnectTimeMs
: Long
how long we've spent disconnecting
|
var
|
halt
: Boolean
set when we want processing to terminate
|
var
|
idleProbe
: Int
how many idle probes we've received from the server. These are empty
lines sent to keep the stream open.
|
var
|
lastReceivedMs
: Long
the time at which we last received a tweet
|
val
|
maxReconnectTries
: Int
how many times we'll try to reconnect when network hiccups occur
|
val
|
name
: java.lang.String
the full URI of the request
|
var
|
readLoopTimeMs
: Long
how long we've spent in a read loop
|
var
|
reader
: java.io.BufferedReader
the reader for the stream for our connection
|
var
|
socketTimeoutMs
: Int
how long to wait for more input on the stream
|
var
|
stream
: java.io.InputStream
the content stream from our connection
|
Method Summary | |
def
|
connect
: Boolean
Establish a connection. This tries only once (reconnect wraps this in retry logic)
Returns true if a connection was established, false otherwise. Note that this
also initializes the stream and reader fields, used by readLoop
|
def
|
deliver
(tweet : java.lang.String) : Unit
If your callback is set, call tweet() on it. Otherwise noop
|
def
|
disconnect
: Unit
Dissconnect from our source
|
def
|
go
: Unit
Connect to the streaming API and start received tweets.
Under the covers this calls setup, then forks a thread that
calls runLoop.
|
def
|
readLine
: java.lang.String
Read a line of input from the stream.
This line should either be a blank line (idle probe) or a full tweet
readLine will block until more data arrives. Not interruptable.
|
def
|
readLoop
: Unit
Read tweets until either halt is set or we get an exception
|
def
|
reconnect
: Unit
Try up to maxRecconnectTries times to connect, with exponentially
increasing backoff times (tries*tries*1000 ms)
|
def
|
runLoop
: Unit
while halt isn't set, perform the following
|
def
|
setup
: Unit
Set up our HTTP connection parameters,
and try to cast our parent to a callbackable form.
|
def
|
stop
: Unit
Stop our read loop, don't process anything else.
|
Methods inherited from Log | |
debug, trace, info, warning, error |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Type Details |
type
T
Value Details |
val
VERSION : java.lang.String
val
name : java.lang.String
var
callbackApplet : <refinement>
var
connectTimeMs : Long
var
readLoopTimeMs : Long
var
disconnectTimeMs : Long
var
idleProbe : Int
var
delimitedReadStall : Int
var
lastReceivedMs : Long
var
connectTimeoutMs : Int
var
socketTimeoutMs : Int
var
client : org.apache.http.impl.client.DefaultHttpClient
var
stream : java.io.InputStream
var
reader : java.io.BufferedReader
var
halt : Boolean
val
delimitedLength : Boolean
val
maxReconnectTries : Int
Method Details |
def
go : Unit
def
setup : Unit
def
runLoop : Unit
def
reconnect : Unit
def
connect : Boolean
def
readLoop : Unit
def
deliver(tweet : java.lang.String) : Unit
def
readLine : java.lang.String
def
stop : Unit
def
disconnect : Unit
ScalaDocs: Tweet Stream
|
|