1 /* Copyright (c) 2009 Nicira Networks
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef OVSDB_TRIGGER_H
17 #define OVSDB_TRIGGER_H 1
23 struct ovsdb_trigger {
24 struct list node; /* !result: in struct ovsdb "triggers" list;
25 * result: in completion list. */
26 struct list *completion; /* Completion list. */
27 struct json *request; /* Database request. */
28 struct json *result; /* Result (null if none yet). */
29 long long int created; /* Time created. */
30 long long int timeout_msec; /* Max wait duration. */
33 void ovsdb_trigger_init(struct ovsdb *, struct ovsdb_trigger *,
34 struct json *request, struct list *completion,
36 void ovsdb_trigger_destroy(struct ovsdb_trigger *);
38 bool ovsdb_trigger_is_complete(const struct ovsdb_trigger *);
39 struct json *ovsdb_trigger_steal_result(struct ovsdb_trigger *);
41 void ovsdb_trigger_run(struct ovsdb *, long long int now);
42 void ovsdb_trigger_wait(struct ovsdb *, long long int now);
44 #endif /* ovsdb/trigger.h */