Giter VIP home page Giter VIP logo

Comments (6)

misterbisson avatar misterbisson commented on May 20, 2024

From @justenwalker in #22 (comment):

In my mind, OnStop makes more sense to happen after the application exits rather than before - so that we know the service isn't interacting with anything before we send cleanup commands (like Finally block)

That raises questions about the inconsistency with of the language compared to onStart. onStart is actually executed before the application starts. The following is a crappy solution, in my mind, but it avoids changing any existing code:

  • onStart before application start
  • onStarted after application start
  • onStop before application stop
  • onStopped after application stop

The following is more clear, in my mind, but does require changing existing code:

  • preStart before application start, the current behavior of onStart
  • postStart after application start
  • preStop before application stop
  • postStop after application stop

...though I hasten to add that I don't really see a need for postStart, I'm just enumerating it for clarity.

from containerpilot.

misterbisson avatar misterbisson commented on May 20, 2024

@justenwalker the title of the ticket may be too specific given our similar, but slightly different interests. Would you be okay with retitling it in a way that fits the conversation about pre and post stopped execution?

from containerpilot.

tgross avatar tgross commented on May 20, 2024

onStarted after application start

This is going to be difficult to actually implement because we block execution flow on the application. Even if we could figure out a way around that, the application can "start" (as in fork) but not actually be "running" for any useful purpose. e.g. slow Java startup times.

onStop before application stop

Services deregister and then stop. Does this happen before or after the service is deregistered?

from containerpilot.

justenwalker avatar justenwalker commented on May 20, 2024

So do we need something like:

  • onStart - Unchanged
  • preStop - Runs before Containerbuddy terminates the application - blocks
  • postStop - Runs after the application terminates

It's not symmetric - but I'm not convinced it needs to be. Does it even make sense to run an application after the App starts? We are already polling the application, which is semantically similar to postStart

from containerpilot.

tgross avatar tgross commented on May 20, 2024

It's not symmetric

That's probably fine.

but I'm not convinced it needs to be. Does it even make sense to run an application after the App starts? We are already polling the application, which is semantically similar to postStart

I'm in agreement there.

from containerpilot.

tgross avatar tgross commented on May 20, 2024

Released with https://github.com/joyent/containerbuddy/releases/tag/0.0.4

from containerpilot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.