Giter Site home page Giter Site logo

momdemo's Introduction

软件架构与中间件实验一

全广播式

启动方式

  • Server直接启动即可
  • Client需要使用环境变量指定行为
    • 环境变量 PUB
      • 指定发布的消息
      • 示例: PUB=A 12:0,B 23:2,C 34:1 代表发布A 12,B 23,C 34三条信息,A立即发送,B在A后延迟2秒发送,C在B后延迟1秒发送
    • 环境变量 REPEAT
      • REPEAT为true时代表重复发送PUB的消息
    • 环境变量 SUB
      • 指定订阅的消息
      • 示例: SUB=A,B,C 代表订阅A,B,C三类消息

选择广播式-点对点

启动方式

  • Server直接启动即可
  • Client需要使用环境变量指定行为
    • 环境变量 PUB
      • 格式与全广播相同
      • 在信息中使用%id,在运行时会被替换成发送的信息的id
    • 环境变量 REPEAT
      • 与全广播相同
    • 环境变量 SUB
      • 创建订阅的消息类型
      • 示例: SUB=A,B,C 代表创建A,B,C三类消息的队列
    • 环境变量 GET
      • 循环获取订阅的消息类型
      • 示例: GET=A,B,C 代表循环获取A,B,C三类消息
    • 环境变量 WAIT
      • 指定循环获取消息的间隔时间
      • 示例: WAIT=1000 代表每次循环获取消息等待1000毫秒

选择广播式-发布订阅

启动方式

  • Server直接启动即可
  • Client需要使用环境变量指定行为
    • 环境变量 PUB
      • 示例: PUB=A 12:1:0,B 23:3:2,C 34:2:1 代表发布A 12,B 23,C 34三条信息,
        A立即发送,B在A后延迟2秒发送,C在B后延迟1秒发送
        A的有效期为1秒,B的有效期为3秒,C的有效期为2秒
      • 在信息中使用%id,在运行时会被替换成发送的信息的id
    • 环境变量 REPEAT
      • 与全广播相同
    • 环境变量 SUB
      • 创建订阅的消息类型
      • 示例: SUB=A,B,C 代表创建A,B,C三类消息的队列

momdemo's People

Contributors

tangweirui2021 avatar

Watchers

 avatar

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.