Class: AgentsControl::Channels::Base
- Inherits:
-
Object
- Object
- AgentsControl::Channels::Base
- Defined in:
- lib/agents_control/channels/base.rb
Overview
The notification channel contract.
There's only one implementation right now — Telegram. The interface is still broken out because the core must not know about buttons and chats: it operates on an event and a reply, and how that's shown to a human is the channel's concern.
A second implementation (ntfy, Slack, whatever) is deliberately not invented ahead of time: the seam is marked out, but guessing its shape before a real need shows up is exactly the kind of complication this project avoids.
Direct Known Subclasses
Instance Method Summary collapse
-
#ask(_event, timeout:) ⇒ Object
Ask a question and return a Reply, or nil once the timeout expires.
-
#notify(_event) ⇒ Object
Notify, expecting nothing back.
-
#ready? ⇒ Boolean
Whether the channel is ready to work: has a token, has someone to talk to.
Instance Method Details
#ask(_event, timeout:) ⇒ Object
Ask a question and return a Reply, or nil once the timeout expires.
21 |
# File 'lib/agents_control/channels/base.rb', line 21 def ask(_event, timeout:) = raise(NotImplementedError) |
#notify(_event) ⇒ Object
Notify, expecting nothing back.
18 |
# File 'lib/agents_control/channels/base.rb', line 18 def notify(_event) = raise(NotImplementedError) |
#ready? ⇒ Boolean
Whether the channel is ready to work: has a token, has someone to talk to.
24 |
# File 'lib/agents_control/channels/base.rb', line 24 def ready? = raise(NotImplementedError) |