prosody 0.5.1-aarch64-linux → 0.6.0-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,133 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Native stubs for the event types that reach a handler: {Prosody::Message},
4
+ # {Prosody::ExciseMessage}, and {Prosody::Timer}.
5
+
6
+ module Prosody
7
+ # Represents a Kafka message with its metadata and payload.
8
+ #
9
+ # Instances of this class are created by the native code and passed to your
10
+ # EventHandler's #on_message method. In RBS, +Message[Payload]+ carries the
11
+ # statically declared payload shape; bare +Message+ defaults to
12
+ # +Prosody::json_value+. This annotation does not add runtime validation.
13
+ #
14
+ # @see ext/prosody/src/handler/message.rs for implementation
15
+ class Message
16
+ # Returns the Kafka topic this message was published to.
17
+ #
18
+ # @return [String] The topic name
19
+ def topic
20
+ raise NotImplementedError, "This method is implemented natively in Rust"
21
+ end
22
+
23
+ # Returns the Kafka partition number for this message.
24
+ #
25
+ # @return [Integer] The partition number
26
+ def partition
27
+ raise NotImplementedError, "This method is implemented natively in Rust"
28
+ end
29
+
30
+ # Returns the Kafka offset of this message within its partition.
31
+ #
32
+ # @return [Integer] The message offset
33
+ def offset
34
+ raise NotImplementedError, "This method is implemented natively in Rust"
35
+ end
36
+
37
+ # Returns the message key used for partitioning.
38
+ #
39
+ # @return [String] The message key
40
+ def key
41
+ raise NotImplementedError, "This method is implemented natively in Rust"
42
+ end
43
+
44
+ # Returns the timestamp when the message was created.
45
+ #
46
+ # @return [Time] The message timestamp
47
+ def timestamp
48
+ raise NotImplementedError, "This method is implemented natively in Rust"
49
+ end
50
+
51
+ # Returns the deserialized message payload.
52
+ #
53
+ # The payload is automatically deserialized from JSON to Ruby objects.
54
+ #
55
+ # @return [Payload] The message content
56
+ def payload
57
+ raise NotImplementedError, "This method is implemented natively in Rust"
58
+ end
59
+
60
+ # Returns the source system of the producer that sent this message.
61
+ #
62
+ # @return [String, nil] The source system, or nil when the message has none
63
+ def source_system
64
+ raise NotImplementedError, "This method is implemented natively in Rust"
65
+ end
66
+
67
+ # Reports whether the producer requested a response to this message.
68
+ # Prosody discards the handler result when it is false.
69
+ #
70
+ # @return [Boolean]
71
+ def response_requested?
72
+ raise NotImplementedError, "This method is implemented natively in Rust"
73
+ end
74
+ end
75
+
76
+ # An excise record with Kafka metadata and no payload.
77
+ class ExciseMessage
78
+ # @return [String] The topic name
79
+ def topic = raise NotImplementedError, "This method is implemented natively in Rust"
80
+
81
+ # @return [Integer] The partition number
82
+ def partition = raise NotImplementedError, "This method is implemented natively in Rust"
83
+
84
+ # @return [Integer] The message offset
85
+ def offset = raise NotImplementedError, "This method is implemented natively in Rust"
86
+
87
+ # @return [String] The message key
88
+ def key = raise NotImplementedError, "This method is implemented natively in Rust"
89
+
90
+ # @return [Time] The record timestamp
91
+ def timestamp = raise NotImplementedError, "This method is implemented natively in Rust"
92
+
93
+ # @return [String, nil] The producer's source system, or nil when the record has none
94
+ def source_system = raise NotImplementedError, "This method is implemented natively in Rust"
95
+
96
+ # @return [Boolean] Whether the producer requested a response to this record
97
+ def response_requested? = raise NotImplementedError, "This method is implemented natively in Rust"
98
+ end
99
+
100
+ # Represents a timer that was scheduled to fire at a specific time.
101
+ #
102
+ # Timer instances are created by the native code and passed to your
103
+ # EventHandler's #on_timer method when a scheduled timer fires.
104
+ #
105
+ # @see ext/prosody/src/handler/trigger.rs for implementation
106
+ class Timer
107
+ # @private
108
+ def initialize
109
+ raise NotImplementedError, "This class is implemented natively in Rust"
110
+ end
111
+
112
+ # Returns the entity key identifying what this timer belongs to.
113
+ #
114
+ # The key is typically the same as the message key that was being processed
115
+ # when the timer was scheduled.
116
+ #
117
+ # @return [String] The entity key
118
+ def key
119
+ raise NotImplementedError, "This method is implemented natively in Rust"
120
+ end
121
+
122
+ # Returns the time when this timer was scheduled to fire.
123
+ #
124
+ # Note: Due to CompactDateTime's second-level precision, the returned time
125
+ # will have zero nanoseconds even if the original scheduled time had
126
+ # sub-second precision.
127
+ #
128
+ # @return [Time] The scheduled execution time
129
+ def time
130
+ raise NotImplementedError, "This method is implemented natively in Rust"
131
+ end
132
+ end
133
+ end