Giter Site home page Giter Site logo

enriquetor's People

Contributors

luinix avatar

Stargazers

 avatar

Watchers

 avatar

enriquetor's Issues

Extract the timeline to its own class

Take a look here: https://github.com/luinix/enriquetor/blob/master/slack/channel.rb#L42-L58

Because we are using async, adding an active wait blocks the thread so the control never goes back to the Slack client and the message is sent. Because of that, if you sleep the typing time, nothing is sent, and everything is sent in one go when you free the thread.

Because of that, I'm using the EventMachine timers, so I setup a "timeline" of what should be sent and when, and then free the thread as soon as I finish. But that also means that, if the enriquetor gets triggered for a reply BEFORE it finishes saying its last bullshit, it just sends both replies at the same time, mixing the messages.

We should extract the timeline to an object that belongs to the channel, and that keeps all the timing correctly.

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.