<commit_before>gwt-webpoller
-------------

[![Build Status](https://secure.travis-ci.org/realityforge/gwt-webpoller.png?branch=master)](http://travis-ci.org/realityforge/gwt-webpoller)

A simple library to provide a simple web poller for GWT.

Quick Start
===========

The simplest way to use the library is to add the following dependency
into the build system. i.e.

```xml
<dependency>
   <groupId>org.realityforge.gwt.webpoller</groupId>
   <artifactId>gwt-webpoller</artifactId>
   <version>0.4</version>
   <scope>provided</scope>
</dependency>
```

Then you add the following snippet into the .gwt.xml file.

```xml
<module rename-to='myapp'>
  ...

  <!-- Enable the websocket library -->
  <inherits name="org.realityforge.gwt.webpoller.WebPoller"/>
</module>
```

Then you can interact with the WebPoller from within the browser.

```java
final WebPoller webPoller = WebPoller.newWebPoller();
final RequestBuilder requestBuilder = new RequestBuilder( RequestBuilder.GET, "http://example.com/someUrl" );
webPoller.setRequestFactory( new HttpRequestFactory( requestBuilder ) );
webPoller.addStartHandler( new StartEvent.Handler()
{
  @Override
  public void onStartEvent( @Nonnull final StartEvent event )
  {
    // Polling started!
  }
} );
webPoller.addStopHandler( new StopEvent.Handler()
{
  @Override
  public void onStopEvent( @Nonnull final StopEvent event )
  {
    // Polling stopped!
  }
} );
webPoller.addMessageHandler( new MessageEvent.Handler()
{
  @Override
  public void onMessageEvent( @Nonnull final MessageEvent event )
  {
    //Handle message
  }
} );
webPoller.addErrorHandler( new ErrorEvent.Handler()
{
  @Override
  public void onErrorEvent( @Nonnull final ErrorEvent event )
  {
    //Handle error
  }
} );
webPoller.start();
...
webPoller.stop();
```

This should be sufficient to put together a simple WebPoller application.

A very simple example of this code is available in the
[gwt-webpoller-example](https://github.com/realityforge/gwt-webpoller-example)
project.<commit_msg>Update the documentation to the latest release<commit_after>gwt-webpoller
-------------

[![Build Status](https://secure.travis-ci.org/realityforge/gwt-webpoller.png?branch=master)](http://travis-ci.org/realityforge/gwt-webpoller)

A simple library to provide a simple web poller for GWT.

Quick Start
===========

The simplest way to use the library is to add the following dependency
into the build system. i.e.

```xml
<dependency>
   <groupId>org.realityforge.gwt.webpoller</groupId>
   <artifactId>gwt-webpoller</artifactId>
   <version>0.6</version>
   <scope>provided</scope>
</dependency>
```

Then you add the following snippet into the .gwt.xml file.

```xml
<module rename-to='myapp'>
  ...

  <!-- Enable the websocket library -->
  <inherits name="org.realityforge.gwt.webpoller.WebPoller"/>
</module>
```

Then you can interact with the WebPoller from within the browser.

```java
final WebPoller webPoller = WebPoller.newWebPoller();
final RequestBuilder requestBuilder = new RequestBuilder( RequestBuilder.GET, "http://example.com/someUrl" );
webPoller.setRequestFactory( new HttpRequestFactory( requestBuilder ) );
webPoller.setListener( new WebPollerListenerAdapter()
{
  @Override
  public void onStart( @Nonnull final WebPoller webPoller )
  {
    // Polling started!
  }

  @Override
  public void onStop( @Nonnull final WebPoller webPoller )
  {
    // Polling stopped!
  }

  @Override
  public void onMessage( @Nonnull final WebPoller webPoller,
                         @Nonnull final Map<String, String> context,
                         @Nonnull final String data )
  {
    //Handle message
  }

  @Override
  public void onError( @Nonnull final WebPoller webPoller, @Nonnull final Throwable exception )
  {
    //Handle error
  }
} );
webPoller.start();
...
webPoller.stop();
```

This should be sufficient to put together a simple WebPoller application.

A very simple example of this code is available in the
[gwt-webpoller-example](https://github.com/realityforge/gwt-webpoller-example)
project.
{'fraction_non_alphanumeric': 0.12537091988130564, 'fraction_numerical': 0.0009891196834817012, 'mean_word_length': 3.957107843137255, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1577555', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1248, 'n_words': 341}