Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uk0/httpwatcher

http watch on
https://github.com/uk0/httpwatcher

Last synced: about 11 hours ago
JSON representation

http watch on

Awesome Lists containing this project

README

        

# httpWatcher
http watch on

```golang
package main

import (
"bufio"
"fmt"
"github.com/astaxie/beego/logs"
"github.com/nahid/gohttp"
"github.com/rs/xid"
"io"
"os"
"strings"
"time"
)
var MiniBatch = 256;
var outTime int64 = 9;
var start = 0;

var (
HttpWatcher *WatchClient
)
var WatchThreadNum = 1;
var ticker = time.NewTicker(time.Duration(outTime) * time.Second) // --- A
type MessageWatcher struct {
start int
offset int
}

type WatchClient struct {
url string
lineHttpChan chan *MessageWatcher
}

var chHttp = make(chan *gohttp.AsyncResponse,100)

func NewHttpWatcher( address string) (afk *WatchClient, err error) {
afk = &WatchClient{
lineHttpChan:make(chan *MessageWatcher,10),
}
if err != nil {
fmt.Printf("Failed to create Connetcion: %s\n", err)
os.Exit(1)
}
afk.url = address;
for i:=0;i