I liked the idea of building an event-driven framework for Twitter4J and
would like to contribute to the project. While going through the source
code of the project, I noticed that currently the modules
twitter4j-async and twitter4j-stream are written in an event-driven
style while twitter4j-core is written in an imperative style. So,
according to my understanding, the idea is to migrate the
imperatively-written modules like twitter4j-core over to an event-driven
model. Am I correct?
I agree with you, I didn't find any functionality in the twitter4j-core
which could be wrapped in a event-driven way. The twitter4j-stream is
already event-driven, but the whole functionality which twitter4j-stream
provides is really thin. When you implement
something, for instance a simple client, you might notice that you have
to deal with problems like network interruption etc.
Yusuke has specified a little about this in the thread "brief project idea":
> For example, if you want to create a simple Twitter client, you may
> want to use the Streaming API (to be precise, it's called "user
> stream") to receive timeline, DMs and such events in realtime.
> Yes, there's already event-driven interfaces.
>
> But once you get into it, you'll notice that you need to deal with
> network difficulties, application restarts and such.
> To fill in the user timeline gap during the application disruption,
> you need to keep track of the last tweet id you received and retrieve
> tweets using the REST API, Search API.
>
> With the framework, application developer will receive events
> transparently and there'll be no need to think about which endpoint to
> use. Instead, the framework will call the app.
> The output of the project would be a combination of the framework
> itself and an example code which uses the framework.
>
> Let me know if you have any question, and feel free to post ideas.
>