Code Monkey home page Code Monkey logo

chat-server's People

Contributors

onepenny avatar

Watchers

 avatar

chat-server's Issues

修改建议

chat-server.routes.websocket 第22行,最好改成

(def current-id (atom 0))
(defn next-id []
  (swap! current-id inc)
  @current-id)

原因: 定义式(defn、def)不推荐放在域内,在某些环境下,这可能导致不可预料的效果

dummy in-memory database最好作为独立的命名空间存在,以方便分离依赖

观察到chat-server.routes.websocket/chatrooms有很多通过id拿chatroom的操作,可以考虑将其用hashmap表示以提高读性能(尤其对于chatroom这类,项数随用户无限制增长的,用filter很可能导致非常低的效率)

Users也有相同问题

使用future-sleep-loop的方式进行定时轮询简单粗暴,但会长期闲置一个线程,可尝试通过core.async的timeout channel实现(可熟悉:CSP异步模型)

命名空间组织较为混乱,逻辑层级关系不清晰,需要整理

项目此规模下只有一个git commit 并不合理,尽量能够在开发时较为频繁地commit,原则上以一句commit能够说明你做的事为准。


这些并没有明确的时间要求,而且多数都是参考意见,可不遵循。
你可以先自己择时修缮起来,好了之后通知我~

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.