Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #1547: Add a new after-async or async phase to triggers #1573

Merged
merged 4 commits into from
Jul 20, 2020

Conversation

conker84
Copy link
Contributor

Fixes #1547

Added the afterAsync phase

Proposed Changes (Mandatory)

A brief list of proposed changes in order to fix the issue:

  • Added the afterAsync phase
  • Added test
  • Updated documentation

@mneedham
Copy link
Contributor

mneedham commented Jul 9, 2020

This looks good to me, what do you think @jexp

I think we need to add something more to the documentation advising users when they should be used the after phase and when they should be using the afterAsync phase. At the moment it says use the latter for 'heavy operations', but if we could give a more specific example I think it'll make the feature more useable

| before | The trigger will be activate right `before` the commit. If no phase is specified, it's the default.
| rollback | The trigger will be activate right after the `rollback`
| after | The trigger will be activate right `after` the commit
| afterAsync | The trigger will be activate right `after` the commit and inside a new transaction that will not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also in a new thread!?

@@ -15,7 +15,9 @@ Enable `apoc.trigger.enabled=true` in `$NEO4J_HOME/conf/apoc.conf` first.

[cols="1m,5"]
|===
| CALL apoc.trigger.add(name, statement, selector) yield name, statement, installed | add a trigger statement under a name, in the statement you can use {createdNodes}, {deletedNodes} etc., the selector is {phase:'before/after/rollback'} returns previous and new trigger information
| CALL apoc.trigger.add(name, statement, selector) yield name, statement, installed | add a trigger statement under a name,
in the statement you can use {createdNodes}, {deletedNodes} etc., the selector is {phase:'before/after/rollback/afterAsync'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change syntax to $createdNodes etc.

@jexp
Copy link
Member

jexp commented Jul 14, 2020

Looks good to me, please merge and forward merge.

@mneedham mneedham merged commit ff64520 into neo4j-contrib:4.0 Jul 20, 2020
mneedham added a commit that referenced this pull request Jul 20, 2020
* fixes #1547: Add a new after-async or async phase to triggers

* Changed parameters to new syntax

* Added "and thread" in afterAsync description

Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>
ivangreene pushed a commit to INNOSOLProject/neo4j-apoc-procedures that referenced this pull request Dec 1, 2020
…ggers (neo4j-contrib#1573)

* fixes neo4j-contrib#1547: Add a new after-async or async phase to triggers

* Changed parameters to new syntax

* Added "and thread" in afterAsync description

Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>
ivangreene pushed a commit to INNOSOLProject/neo4j-apoc-procedures that referenced this pull request Dec 4, 2020
…ggers (neo4j-contrib#1573)

* fixes neo4j-contrib#1547: Add a new after-async or async phase to triggers

* Changed parameters to new syntax

* Added "and thread" in afterAsync description

Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>
mneedham added a commit that referenced this pull request Dec 4, 2020
…#1735)

* fixes #1547: Add a new after-async or async phase to triggers

* Changed parameters to new syntax

* Added "and thread" in afterAsync description

Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>

Co-authored-by: Andrea Santurbano <santand@gmail.com>
Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>
conker84 added a commit to conker84/neo4j-apoc-procedures that referenced this pull request Mar 29, 2021
…ggers (neo4j-contrib#1573) (neo4j-contrib#1735)

* fixes neo4j-contrib#1547: Add a new after-async or async phase to triggers

* Changed parameters to new syntax

* Added "and thread" in afterAsync description

Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>

Co-authored-by: Andrea Santurbano <santand@gmail.com>
Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>
conker84 added a commit that referenced this pull request Apr 12, 2021
…#1735)

* fixes #1547: Add a new after-async or async phase to triggers

* Changed parameters to new syntax

* Added "and thread" in afterAsync description

Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>

Co-authored-by: Andrea Santurbano <santand@gmail.com>
Co-authored-by: Michael Hunger <github@jexp.de>
Co-authored-by: Mark Needham <m.h.needham@gmail.com>
This pull request was closed.
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.

Add a new after-async or async phase to triggers
3 participants