AndreasFagschlunger / O2Xfs

Java API for accessing CEN/XFS API, EMV Level 2 Kernel
47 stars 28 forks source link

Update ReadCardCommand.java #10

Closed msynk closed 9 years ago

msynk commented 9 years ago

added timeout.

AndreasFagschlunger commented 9 years ago

I think to allow Timeout on every command may be an overhead, if you check the XfsServiceConfig-Class, there is a method getXfsExecuteTimeout(XfsExecuteCommand) which should return the timeout for the specific command from a configuration. It's not fully implemented yet, since the command parameter is not used. May a configurable timeout be suitable for your use case?

msynk commented 9 years ago

I think async operations should have an entry for a custom timeout, other than the configurable values, just like the XfsExecuteCommand itslef. In my opinion, if its possible to implement it with a few lines of code, its not an overhead. Using just one configured timeout for all async commands is not suitable in these situations. For example i need to assign an infinite timeout (0) to a ReadCardCommand, and with current implementation i can't.

msynk commented 9 years ago

what is your suggestion for my problem, about specifying infinite timeout in a "ReadCardCommand"?

AndreasFagschlunger commented 9 years ago

The default timeout is infinite. It is planned that you can overwrite timeouts by configuration - in the O2Xfs Service Layer (at.o2xfs.xfs.service).