getsentry/rust_arroyo

Make Partition/Message structures reference a 'static Topic

Open

#11 建立於 2022年5月20日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Rust (0 fork)auto 404
good first issue

倉庫指標

Star
 (2 star)
PR 合併指標
 (PR 指標待抓取)

描述

Topics are created at the startup of the application and live for its entire duration. We can make this a requirement for the time being. That means that partitions and messages do not need to own an instance of a Topic as they do here https://github.com/getsentry/rust_arroyo/blob/main/src/types/mod.rs#L35.

The current implementation means that every time we create a partition we make a copy of the topic. If we make the lifetime of Topic 'static, we should be able to make Partition reference a Topic instead.

A fancier version would be to still make Partition reference a Topic, but giving it a specific lifetime so that an application can instantiate Topics dynamically, but still tie the lifetime of all partitions to the lifetime of the Topic.

貢獻者指南