Skip to content

Commit

Permalink
chore(streamer): done with the engine!
Browse files Browse the repository at this point in the history
  • Loading branch information
wildonion committed Sep 21, 2024
1 parent 8a31e16 commit d3d8dd6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 49 deletions.
43 changes: 0 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ sea-orm = { version = "1.0.1", features = [
"with-json",
"with-uuid"
]}
prost = "0.13"
prost-types = "0.13"
themis = "0.14.0"
base58 = "0.2.0"
rand_chacha = "0.3"
Expand Down
35 changes: 35 additions & 0 deletions proto/notif.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

syntax = "proto3";

import "google/protobuf/struct.proto";

package notifications;

// Enum for action types
enum ActionType {
ACTION_TYPE_UNSPECIFIED = 0; // Default unspecified action type
PRODUCT_PURCHASED = 1; // Product purchased or minted
ZERLOG = 2; // Zerlog action type
EVENT_CREATED = 3; // Event created
EVENT_EXPIRED = 4; // Event expired
EVENT_LOCKED = 5; // Event locked
}

// Message to hold NotifData
message NotifData {
string id = 1; // Corresponds to Rust's String
string receiver_info = 2; // Corresponds to Rust's String
google.protobuf.Struct action_data = 3; // Nested message for action data (serde_json::Value equivalent)
string actioner_info = 4; // Corresponds to Rust's String
ActionType action_type = 5; // Enum for action type
int64 fired_at = 6; // Corresponds to Rust's i64
bool is_seen = 7; // Corresponds to Rust's bool
}

// Message for arbitrary action data (serde_json::Value equivalent)
// You can modify the structure of ActionData as per your actual use case
message ActionData {
string json = 1; // This can hold serialized JSON as a string
}


9 changes: 5 additions & 4 deletions src/workers/notif/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@


/* ========================================================================================
/* ====================================================================================
REALTIME NOTIF EVENT STREAMING DESIGN PATTERN (README files inside docs folder)
========================================================================================
====================================================================================
MAKE SURE YOU'VE STARTED CONSUMERS BEFORE PRODUCING
THEY MUST BE READY FOR CONSUMING WHILE PRODUCERS ARE
SENDING MESSAGES TO THE BROKER.
SENDING MESSAGES TO THE BROKER. USUALLY RUN THE PRODUCER
USING CLI AND THE CONSUMER AT STARTUP.
NotifBrokerActor is the worker of handling the process of publishing and consuming
messages through rmq, redis and kafka, talking to the NotifBrokerActor can be done
Expand All @@ -22,7 +23,7 @@
a place where the application logic which is likely a server is being started.
************************************************************************************
========================================================================================
====================================================================================
*/

use constants::STORAGE_IO_ERROR_CODE;
Expand Down

0 comments on commit d3d8dd6

Please sign in to comment.