graphile-engine icon indicating copy to clipboard operation
graphile-engine copied to clipboard

feat(pg-pubsub): add option to immediately get a result on listen

Open ol-teuto opened this issue 3 years ago • 4 comments

Description

Motivation:

Pretty much the same as https://github.com/graphile/graphile-engine/pull/612

subscription MySubscription {
  listen(topic: "user:2", immediate: true) {
    relatedNodeId
    query {
      user(id: "2") {
        email
      }
    }
  }
}

This allows to get a live view of the user email with id 2. Without the option to immediately trigger the query, this would depend on something triggering a NOTIFY first.

This is a non breaking change that adds a feature, it's off by default.

It seems like the tests only check the generated schema, so I only updated that test and didn't add a new one

Regarding documentation, should I open a PR on https://github.com/graphile/graphile.github.io before this is merged?

Performance impact

This is optional and disabled by default, thus there is no performance impact

Security impact

I can't think of a scenario where this impacts security

Checklist

  • [x] My code matches the project's code style and yarn lint:fix passes.
  • [ ] I've added tests for the new feature, and yarn test passes.
  • [ ] I have detailed the new feature in the relevant documentation.
  • [ ] I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • [ ] If this is a breaking change I've explained why.

ol-teuto avatar Oct 07 '22 12:10 ol-teuto

reserver's are not good at scouting, they are too heavy: claim body part to move over swamps maybe your could transform them into claimer if Memory.myRooms.length < Game.gcl.level https://github.com/TooAngel/screeps/blob/8221c00ae9bc6f0b92d5c480b29767e200d96344/src/role_claimer.js

mschultheiss83 avatar Sep 09 '22 08:09 mschultheiss83

recycle it for now and see if it can do. I planned to build a mechanism to:

  1. add to recycle list
  2. check build queue and fetch usable creep in recycle list, and fetch out some useful creeps to make them work.
  3. real recycle the useless creeps.

XenoAmess avatar Sep 09 '22 16:09 XenoAmess

reserver's are not good at scouting, they are too heavy: claim body part to move over swamps

yes it be. it moves really slow...

XenoAmess avatar Sep 09 '22 16:09 XenoAmess

I thought about it this way.

If a room is controlled, we don't start to reserve it. If it is not controlled and we start to reserve it, it is our room. So we reserve and harvest it. If someone attacks the room, we need to defend it and not just stop harvesting.

TooAngel avatar Jan 30 '23 21:01 TooAngel