论文标题
分布式反应性程序中的拓扑水平反应性:使用羊群的反应性熟人管理
Topology-Level Reactivity in Distributed Reactive Programs: Reactive Acquaintance Management using Flocks
论文作者
论文摘要
反应性编程是程序驱动的应用程序的一种流行范式,并且通常建议将其作为编写分布式应用程序的范例。一种类型的应用程序是 * Prosumer *应用程序,它们是生产和消费许多事件的分布式应用程序。我们分析使用反应性编程语言或框架实现生产应用程序时发生的问题。我们发现,开放网络的假设(这意味着各种类型的生产者自发地加入并离开网络,可能会导致大量代码复杂性或运行时间效率低下。在这些问题的基础上, *熟人管理 *:在加入并离开网络时发现伪造者的能力,并在整个反应性程序中正确维护该状态。大多数现有的反应性编程语言和框架对管理熟人的支持有限,从而导致代码或效率低下的计算意外复杂性。 在本文中,我们介绍了用于反应性计划的熟人管理。首先,我们设计了一个 *熟人发现 *机制来创建一个 *羊群 *自动发现网络上的造物主。羊群的一个重要方面是它们与反应性程序的整合,以便一个反应性程序可以正确有效地维护其状态。为此,我们设计了*熟人维护*机制:一种用于功能反应性编程语言的新型操作员,我们称为`deploy-*'。部署 - *`操作员可以对发现的生产商的时变收集进行正确有效的反应。所提出的机制是用一种称为Stella的反应性编程语言实施的,该语言是一种语言工具来展示我们方法的思想。我们熟人管理的实施导致计算高效和惯用的反应性代码。 我们通过基准进行定量评估我们的方法,这些基准表明我们的实现是有效的:每当发现新的生产商或删除连接的生产商时,计算都会有效地更新。为了评估我们原型实现的分布式功能,我们实施了一个用例,该用例模拟布鲁塞尔的自行车共享基础架构,并在Raspberry Pi Cluster计算机上运行它。我们认为我们的工作是使用功能反应性编程来构建开放网络的分布式系统的重要步骤,换句话说,分布式反应性程序涉及许多自发加入并离开网络的造型设备和传感器。
Reactive programming is a popular paradigm to program event-driven applications, and it is often proposed as a paradigm to write distributed applications. One such type of application is *prosumer* applications, which are distributed applications that both produce and consume many events. We analyse the problems that occur when using a reactive programming language or framework to implement prosumer applications. We find that the assumption of an open network, which means prosumers of various types spontaneously join and leave the network, can cause a lot of code complexity or run-time inefficiency. At the basis of these issues lies *acquaintance management*: the ability to discover prosumers as they join and leave the network, and correctly maintaining this state throughout the reactive program. Most existing reactive programming languages and frameworks have limited support for managing acquaintances, resulting in accidental complexity of the code or inefficient computations. In this paper we present acquaintance management for reactive programs. First, we design an *acquaintance discovery* mechanism to create a *flock* that automatically discovers prosumers on the network. An important aspect of flocks is their integration with reactive programs, such that a reactive program can correctly and efficiently maintain its state. To this end we design an *acquaintance maintenance* mechanism: a new type of operator for functional reactive programming languages that we call `deploy-*`. The `deploy-*` operator enables correct and efficient reactions to time-varying collections of discovered prosumers. The proposed mechanisms are implemented in a reactive programming language called Stella, which serves as a linguistic vehicle to demonstrate the ideas of our approach. Our implementation of acquaintance management results in computationally efficient and idiomatic reactive code. We evaluate our approach quantitatively via benchmarks that show that our implementation is efficient: computations will efficiently update whenever a new prosumer is discovered, or a connected prosumer is dropped. To evaluate the distributed capabilities of our prototype implementation, we implement a use-case that simulates the bike-sharing infrastructure of Brussels, and we run it on a Raspberry Pi cluster computer. We consider our work to be an important step to use functional reactive programming to build distributed systems for open networks, in other words, distributed reactive programs that involve many prosumer devices and sensors that spontaneously join and leave the network.