From 45d3a8670da1d40145202ed42129c7cddba18df5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 6 Jul 2021 15:15:21 +0200 Subject: ASAP::O: Group ID stuff --- src/im-sandbox.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/im-sandbox.c') diff --git a/src/im-sandbox.c b/src/im-sandbox.c index ed58a3be..654f07d1 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -62,6 +62,7 @@ #include "process_image.h" #include "im-zmq.h" #include "profile.h" +#include "im-asapo.h" struct sandbox @@ -110,6 +111,7 @@ struct sandbox const char *asapo_token; const char *asapo_beamtime; const char *asapo_path; + AsapoStringHandle asapo_group_id; /* Final output */ Stream *stream; @@ -356,12 +358,13 @@ static int run_work(const struct index_args *iargs, Stream *st, } if ( sb->asapo ) { - zmqstuff = im_zmq_connect(sb->zmq_address, - sb->zmq_subscriptions, - sb->n_zmq_subscriptions, - sb->zmq_request); - if ( zmqstuff == NULL ) { - ERROR("ZMQ setup failed.\n"); + asapostuff = im_asapo_connect(sb->asapo_endpoint, + sb->asapo_token, + sb->asapo_beamtime, + sb->asapo_path, + sb->asapo_group_id); + if ( asapostuff == NULL ) { + ERROR("ASAP::O setup failed.\n"); return 1; } } @@ -1077,6 +1080,7 @@ int create_sandbox(struct index_args *iargs, int n_proc, char *prefix, int n_zmq_subscriptions, const char *zmq_request, const char *asapo_endpoint, const char *asapo_token, const char *asapo_beamtime, const char *asapo_path, + const char *asapo_group_id, int timeout, int profile) { int i; @@ -1132,6 +1136,15 @@ int create_sandbox(struct index_args *iargs, int n_proc, char *prefix, return 0; } + if ( asapo_group_id != NULL ) { + sb->asapo_group_id = im_asapo_group_id_from_string(asapo_group_id); + } else { + sb->asapo_group_id = im_asapo_make_unique_group_id(asapo_endpoint, + asapo_token, + asapo_beamtime, + asapo_path); + } + sb->fds = NULL; sb->fhs = NULL; sb->stream = stream; -- cgit v1.2.3