Skip to content

Calls and plugins#59

Merged
schandrika merged 3 commits intoeclipse-volttron:developfrom
davidraker:calls_and_plugins
Mar 18, 2026
Merged

Calls and plugins#59
schandrika merged 3 commits intoeclipse-volttron:developfrom
davidraker:calls_and_plugins

Conversation

@davidraker
Copy link
Copy Markdown
Contributor

This pull request introduces several improvements to the platform_driver agent, focusing on better agent shutdown handling, improved heartbeat logic, and some dependency cleanup. The key changes involve using a gevent event to signal agent shutdown, refactoring the heartbeat mechanism to be more responsive to agent stop events, and removing an unnecessary installation step from setup.py.

Agent shutdown and heartbeat improvements:

  • Added a _stop_agent event to the agent and a @Core.receiver('onstop') handler to set this event when the agent is stopping, enabling coordinated and graceful shutdown of greenlets. [1] [2]
  • Updated the heart_beat method to run in a loop, checking for the _stop_agent event and sleeping dynamically based on the number of remotes. This ensures heartbeats stop promptly when the agent is stopped and distributes the heartbeat interval across remotes.
  • Changed the heartbeat greenlet to use gevent.spawn instead of self.core.periodic, giving more control over the heartbeat loop and its termination.

Dependency and import updates:

  • Added import of Event from gevent.event to support the new shutdown mechanism.
  • Updated imports to include Core from the appropriate vip.agent module for both client and platform contexts, enabling the use of the @Core.receiver decorator. [1] [2]

Setup script cleanup:

  • Removed the installation of vdrv from setup.py, streamlining the setup process.

…. setup_vdrv.py will need to be run separately due to how vctl install uses the main setup.py.
@davidraker davidraker requested a review from schandrika March 12, 2026 18:43
@schandrika schandrika merged commit 229d19f into eclipse-volttron:develop Mar 18, 2026
3 of 5 checks passed
@davidraker davidraker deleted the calls_and_plugins branch March 20, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants