Idempotent & Associative logic is awesome

Поделиться
HTML-код
  • Опубликовано: 11 дек 2024

Комментарии • 5

  • @ProgramArtist
    @ProgramArtist  7 лет назад

    Let me know what would you like me to talk about, it can be anything as long as it is programming related

  • @vlad981
    @vlad981 7 лет назад +1

    Thanks for the video!
    I just wondering what would be right solution if player's point can go not only positive, but also negative?
    Than I guess we should use some sort of ID, and send messages like { id: 1, points:13 } -> { id: 2, points:17 } -> { id: 3, points:19 }, or some timestamps instead of ID. Is that would be Idempotent and Associative in this case?

    • @ProgramArtist
      @ProgramArtist  7 лет назад

      Vlad Yup, some sequence or timestamp would work.

  • @devloperuniversal845
    @devloperuniversal845 5 лет назад

    Hiya, I am confused with a different problem and a different approach. At the beginning to suppress the queue but in the end you using pub/sub. Another example at 13:05 state 13->17->19 .. 13->19->19 got it u are checking greater value. how about this 13->-21->19?

    • @ProgramArtist
      @ProgramArtist  5 лет назад

      Not really sure what you are asking in the first question.
      Regarding the 2nd question:
      If you mean what happens if the 1st player sends 13->21->19: for this case you can attach a timestamp to the message use the message on the 2nd player side only if the time is greater than the time of the last message.
      If you mean what happens if the 2nd player receives 13->21->19: for this case the states that the 2nd player will see will be 13->21->21