Code Monkey home page Code Monkey logo

darwinpush's Introduction

This library is based on fasteroute/darwinpush, but we're planning to move fast and break things.

Our goals are to build a strong base for our bigdatadarwin project.

It is a work in progress.

darwinpush's People

Contributors

grundleborg avatar vladvelici avatar axsaucedo avatar

Watchers

 avatar James Cloos avatar George Corney avatar ms avatar Jeremy Chui avatar  avatar  avatar

darwinpush's Issues

Parse XML logs from FTP

The messages sent over STOMP are updates, and if some updates are missing the data does not reflect the reality.

Adding a way to parse the darwin logs from FPT given a start timestamp would help address this issue.

The messages taken from the logs need to be sent over to the listener implemented by the client (user of this library) just as the STOMP messages, and the order should be as they were sent from Darwin. This makes all the complicated logic of going to FTP, downloading XMLs, and then connecting to STOMP transparent to the client.

Maybe an extra, optional argument on the on_*_message methods to indicate the source would be nice.

Determine whether logs or a snapshot is required

We aim to attack all the pain points so I purpose a simple interface for handling logs and snapshots.

They happen quite transparently, but this should also be configurable at client/user level.

Darwin keeps messages on queues for 5 minutes after you disconnect. Thus if the library is given a parameter, downtime, it would be easy to decide whether to download logs or a snapshot for XML.

Values for downtime:

<=0     - first start of the application, download snapshot
>0      - seconds of downtime, based on which the library decides how many logs to download, or maybe no logs (if less than 5 minutes)
None    - do not download anything over FTP, just connect to STOMP

Graceful shutdown bug

Sometines when you shutdown the server it all goes nice and smooth, but sometimes it doesn't.

There are three processes running: main stomp client, listener and parser.

The data flows like this: stomp client -> parser -> listener.

the parser has a queue from which it takes one message at a time, parses it, and puts it into the listener queue.

The queues block when they are empty to wait for a message, and that's the problem. Nothing signals the empty queue to unblock when the close signal was sent, so the clean disconnect only happens when there are unprocessed messages.

When there are unprocessed messages, the queue does not block and the quit variable gets read.

A simple solution would be a dummy/None message sent over to the queues when the processes are about to quit to avoid the deadlock.

Add trainId to Schedule object

The trainId attribute in the XML is missing from the objects, or at least is seems to be missing.

XML example:

<Journey rid="201509241060735" uid="Y57914" trainId="5S20" ssd="2015-09-24" toc="GR" trainCat="EE" isPassengerSvc="false">
  <OPOR tpl="ABRDEEN" act="TB" plat="5" wtd="21:25" />
  <OPIP tpl="ABRD27" act="OP" wta="21:30" wtd="21:40" />
  <OPDT tpl="ABRDCH" act="TF" wta="21:45" />
</Journey>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.