Changeset View
Changeset View
Standalone View
Standalone View
src/docs/user/userguide/events.diviner
Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | - `query` The author or committer string being looked up. This will usually | ||||
comes from the commit metadata so it may not be well-formatted. | comes from the commit metadata so it may not be well-formatted. | ||||
- `result` The current result from the lookup (Phabricator's best guess at | - `result` The current result from the lookup (Phabricator's best guess at | ||||
the user PHID of the user named in the "query"). To substitute the result | the user PHID of the user named in the "query"). To substitute the result | ||||
with a different result, replace this with the correct PHID in your event | with a different result, replace this with the correct PHID in your event | ||||
listener. | listener. | ||||
Using @{class@libphutil:PhutilEmailAddress} may be helpful in parsing the query. | Using @{class@libphutil:PhutilEmailAddress} may be helpful in parsing the query. | ||||
== Search: Did Update Index == | |||||
The constant for this event is | |||||
`PhabricatorEventType::TYPE_SEARCH_DIDUPDATEINDEX`. | |||||
This event is dispatched from the Search application's indexing engine, after | |||||
it indexes a document. It allows you to publish search-like indexes into other | |||||
systems. | |||||
Note that this event happens after the update is fully complete: you can not | |||||
prevent or modify the update. Further, the event may fire significantly later | |||||
in real time than the update, as indexing may occur in the background. You | |||||
should use other events if you need guarantees about when the event executes. | |||||
Finally, this event may fire more than once for a single update. For example, | |||||
if the search indexes are rebuilt, this event will fire on objects which have | |||||
not actually changed. | |||||
So, good use cases for event listeners are: | |||||
- Updating secondary search indexes. | |||||
Bad use cases are: | |||||
- Editing the object or document. | |||||
- Anything with side effects, like sending email. | |||||
Data available on this event: | |||||
- `phid` The PHID of the updated object. | |||||
- `object` The object which was updated (like a @{class:ManiphesTask}). | |||||
- `document` The @{class:PhabricatorSearchAbstractDocument} which was indexed. | |||||
This contains an abstract representation of the object, and may be useful | |||||
in populating secondary indexes because it provides a uniform API. | |||||
== Test: Did Run Test == | == Test: Did Run Test == | ||||
The constant for this event is | The constant for this event is | ||||
`PhabricatorEventType::TYPE_TEST_DIDRUNTEST`. | `PhabricatorEventType::TYPE_TEST_DIDRUNTEST`. | ||||
This is a test event for testing event listeners. See above for details. | This is a test event for testing event listeners. See above for details. | ||||
== UI: Did Render Actions == | == UI: Did Render Actions == | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |