Globals-ePy-vs-ISOS

Downloads28
Subscribe
0
Bookmark
1
This application is not supported by InterSystems Corporation. Please be notified that you use it at your own responsibility.
Details
Releases
Reviews
Issues
Articles

What's new in this version

move to archive

Globals-ePy-vs-ISOS

This example demonstrates the difference you may experience when you access globals
directly from Embedded Python compared to native ObjectScript.

To make this demo useful I start 2 background jobs that simply write sequentially
to a dedicated global. A common control method signals for a synchronous start.
Similar a common stop & view interrupts data feeding.

As 2 jobs run in parallel the probability of just using sequential blocks is reduced.
During the development of this demo, I detected that the JOB command has problems
with ClassMethods in Embedded Python.
WARNING:
Due to the poor dimensioned Community License the start of the background jobs
may fail if you have other connections active at the same time.

During my series of test, I found that ePy writes ~53% of the pure ISOS code
See also examples below.

The control method prepares the background processes and has 3 commands:

  • 0 .. stop background jobs and show last run results
  • 1 .. interrupt background jobs and show last run results
  • 2 .. run data load in background jobs.
    Loading is interrupted after 60 sec to prevent breaking of the DB
    if not done manually

How to Test it

Connect to IRIS by sessin or bs terminal

Example

USER>do ##class(dc.rcc.ePYvsISOS).do()

JobStart ISOS #3841
JobStart ePy #3842
Job Control [0=stop,1=view,2=go]: 2
Job Control [0=stop,1=view,2=go]: 1
^ePy(1,492029)=2022-03-11 20:49:32.851286
^ISOS(1,927383)=2022-03-11 20:49:32.851289

Job Control [0=stop,1=view,2=go]:
Job Control [0=stop,1=view,2=go]: 2
Job Control [0=stop,1=view,2=go]:
Job Control [0=stop,1=view,2=go]:
Job Control [0=stop,1=view,2=go]:
Job Control [0=stop,1=view,2=go]:
^ePy(2,4149270)=2022-03-11 20:50:54.620362
^ISOS(2,7719690)=2022-03-11 20:50:54.620371

Job Control [0=stop,1=view,2=go]:2
Job Control [0=stop,1=view,2=go]:
Job Control [0=stop,1=view,2=go]: 0
^ePy(3,3148765)=2022-03-11 20:50:54.620362
^ISOS(3,6714519)=2022-03-11 20:50:54.620371

Article in DC.PT
Article in DC.EN

Video

Rating
5 (1)
ObjectScript quality test
Passed
Updated on 25 March 2023
ObjectScript quality report
Category
Technology Example
Works with
InterSystems IRIS
Tags
Info
Version
0.0.3
Last updated
2023-04-15
Repository
Open
Documentation
Open
License
Link