Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asapo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joao Alvim Oliveira Dias De Almeida
asapo
Commits
0c4adfb0
Commit
0c4adfb0
authored
1 year ago
by
Mikhail Karnevskiy
Browse files
Options
Downloads
Patches
Plain Diff
Remove static function to fix producer.
parent
02cd1e93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
producer/api/python/asapo_producer.pyx.in
+18
-21
18 additions, 21 deletions
producer/api/python/asapo_producer.pyx.in
with
18 additions
and
21 deletions
producer/api/python/asapo_producer.pyx.in
+
18
−
21
View file @
0c4adfb0
...
...
@@ -463,26 +463,6 @@ cdef class PyProducer:
with nogil:
if self.c_producer.get() is not NULL:
self.c_producer.get().StopThreads__()
@staticmethod
def __create_producer(endpoint,type,instance_id,pipeline_step,beamtime_id,beamline,data_source,token,nthreads,timeout_ms):
pyProd = PyProducer()
cdef Error err
cdef SourceType source_type
err = GetSourceTypeFromString(type,&source_type)
if err:
throw_exception(err)
cdef SourceCredentials source
source.instance_id = instance_id
source.pipeline_step = pipeline_step
source.beamtime_id = beamtime_id
source.beamline = beamline
source.user_token = token
source.data_source = data_source
source.type = source_type
pyProd.c_producer = Producer.Create(endpoint,nthreads,RequestHandlerType_Tcp,source,timeout_ms,&err)
if err:
throw_exception(err)
return pyProd
def create_producer(endpoint,type,beamtime_id,beamline,data_source,token,nthreads,timeout_ms,instance_id='auto',pipeline_step='auto'):
"""
...
...
@@ -508,7 +488,24 @@ def create_producer(endpoint,type,beamtime_id,beamline,data_source,token,nthread
AsapoWrongInputError: wrong input (number of threads, ,,,)
AsapoProducerError: actually should not happen
"""
return PyProducer.__create_producer(_bytes(endpoint),_bytes(type),_bytes(instance_id),_bytes(pipeline_step),_bytes(beamtime_id),_bytes(beamline),_bytes(data_source),_bytes(token),nthreads,timeout_ms)
pyProd = PyProducer()
cdef Error err
cdef SourceType source_type
err = GetSourceTypeFromString(_bytes(type),&source_type)
if err:
throw_exception(err)
cdef SourceCredentials source
source.instance_id = _bytes(instance_id)
source.pipeline_step = _bytes(pipeline_step)
source.beamtime_id = _bytes(beamtime_id)
source.beamline = _bytes(beamline)
source.user_token = _bytes(token)
source.data_source = _bytes(data_source)
source.type = source_type
pyProd.c_producer = Producer.Create(_bytes(endpoint),nthreads,RequestHandlerType_Tcp,source,timeout_ms,&err)
if err:
throw_exception(err)
return pyProd
__version__ = "@PYTHON_ASAPO_VERSION@@ASAPO_VERSION_COMMIT@"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment